Skip to main content

Full text of "Computer Language - Issue 06 (1985-02)(CL Publications)(US)"

See other formats


COMPUTER 



$2.95 



LANGUAGE 



TM 



VOLUME 2, NUMBER 2 



FEBRUARY 1985 



* 

T 




C CHAIRMAN REPORTS 
ON ANSI STANDARD 

PJ. PLAUGER 
LOOKS BACK 

A UNIQUE LANGUAGE 
CALLED MUMPS 

TWENTY-ONE 
COMPILERS COMPARED 



SPECIAL C ISSUE 




PSSST 



JANUS/Ada 

$99.95!! 




PRESENTING THE NEW 
JANUS/Ada C-PAKH 



Janus/Ada Compiler 

Janus/Ada Linker 

Janus/Ada Libraries 

Janus/ Ada Example/ 

Programs 

Janus /Ada User Manual 



AND THESE ADDED 
FEATURES!! 

1. Free User's Group 

2. $99.95 Discount on 
the Janus/Ada D-Pak 

3. No License!! 

4. No Copy Protection!!! 

5. Customer tested for 
over 3 years!!! 



This is the introductory Ada™ package you've been waiting 
for , . . over three years of actual field use, specifically on 
microcomputers, by the government, Fortune 500 businesses 
and major universities. Realistically priced, at $99.95, so you 
can afford the most popular Ada implementation used on 
microcomputers! 

The new "C"-Pak is available for most microcomputers 
running MS-DOS, including the IBM PC AT™, as are all the 
other fine Janus/Ada programs. Call us or an authorized 
distributor for your copy today! 



Naiional Distributors 



Internationa] Distributors 



Westico, Inc. 
25 Van Zant St. 
NorualU. CI' 06855 
(203) 853-6880 



Trinity Solutions 
5340 Thornwood Dr. 
San Jose, CA 95123 
(408) 226-0170 



ASH II 
7407 Marisol 
Houston, TX 77083 
(713)933-1828 



A. O.K. Computers 

816 Easley St., Suite 615 

Silver Springs, MD 20910 

(301)588-8446 



Ada Australia 
218 Lutwyche Rd. 
Windsor 4030 
QLD. Australia 
(07) 57 9997 



Microprogramming, Inc. 
Suite 102 P.O. Box 3356 

Chatsworlh, C A 91313 
(818)993-6475 



Progesco 

155, rue du Faubourg 

St. -Denis 

75010 Paris 

France 

(I) 205.39. 47 

Lifeboat. Inc. Japan 
3-6, Kando-Nishikicho 
Chivoda-Uu 
Tokyo 101.. JAPAN 
03-293-4711 



ET M.C? M-». CCP K»»>rn»irni«iknilP**»*l K«""' 
■ADA n ; iiarfrmaik of Th* V S Dirj«r.m« l i •* D*h**» 
Mb DOS rl ■ indrmjik nf Mk)9H<i 




'Copyright 1984 HR Software 






OFTWARE, INC. 



specialists in state of the art programming 



P O Box 1512 Madison, Wisconsin 53701 
(608) 244-6436 TELEX 4998168 



CIRCLE 58 ON READER SERVICE CARD 



PASCAIC COMPIf 



ALA CART 



Make Whitesmiths, Ltd. Part 
of Your 1985 Software Strategy 

For six years, software developers and systems integrators have looked to Whitesmiths Ltd 
ror technologically superior compilers and multi-tasking operating systems. 

Before you make your next move, contact Whitesmiths, Ltd. 




Whitesmiths, Ltd. 
97 Lowell Road 
Concord, MA 01 742 

TLX 95 1 708 SOFTWARE CNCM. 



Whitesmiths, Ltd. 

DISTRIBUTORS: Australia. Fawnray Pty Ltd.. Hurstvllle. (612) 570-6100; Japan Advanced 
Data Con rols Corp ,. Chiyoda-ku. Tokyo (03) 263-0383; United Kingdom, Real T.me Systems 
Douglas. Isle ol Man 0624-26021. Sweden, Un.sol, A B Gotebenj. 31-126810. * ys ' ems - 

CIRCLE 85 ON READER SERVICE CARD 



Squeeze More Out Of Every 
On-Line Minute. 




Presenting the software 
package that makes your 
computer more productive 
and cost-efficient. 



CompuServe's new Vidtex"" is compatible 
with many personal computers sold today 
(including Apple,® Commodore® and 
Tandy/Radio Shack® brands). And it offers 
the following features *-and more-to let 
you communicate more economically 
with most time-sharing services (including 
CompuServe's Information Service). 

Auto-Logon. Lets you log on to a host 
simply and quickly by utilizing prompts 
and responses defined by you. Also allows 
qu ick transmission of p redefined responses 
to host application programs after 
logging on. 

•Some versions of the Vidtex software do not implement all features listed 

Vidtex is a trademark of CompuServe, Incorporated Apple is a trademark ol Apple Computet; Inc. Commodore is > trademark of 

Commodore Business Machines. Radio Shack is a trademark uf Tandy Corp. 



Function Keys. Let you consolidate 
long commands into single keystrokes. 
Definitions can be saved to and loaded 
from disk file, allowing multiple definitions 
for multiple applications. 

Error- Free Uploading and Down- 
loading. CompuServe 'B' Protocol con- 
tained in Vidtex lets you transfer from 
your computer to CompuServe and from 
CompuServe to your computer anywhere 
in the country. Also provides error-free 
downloading from CompuServe's exten- 
sive software libraries. 

Full Printer Support. Printer buffer 
automatically buffers characters until 
printer can process; automatically stops 
on-line transmission when full; and 
automatically resumes transmission 
when capacity is re-established. Also, lets 
you print contents of textual video screen 
or RAM buffer at any time. 



Capture Buffer. Saves selected 
parts of a session. Contents can be 
written to a disk file; displayed both on and 
off line; loaded from disk; and transmitted 
to the host. 

On-line Graphics. Integral graphics 
protocol displays stock charts, weather 
maps and more. 

If you are already a CompuServe sub- 
scriber, you can order Vidtex on line by 
using the GO ORDER command. Other- 
wise, check with your nearest computer 
dealer; or to order direct, call or write: 



CompuServe 

P.O. Box 20212, 500O Arlington Centre Blvd. 
Columbus, Ohio 43220 

1-800-848-8199 

In Ohio, call 614-457-0802 
An H&R Block Company 
CIRCLE 7 ON READER SERVICE CARD 



COMPUTER 



LANGUAGE 



ARTICLES 



The Standardization of C 

by Jim Brodie 

As a language well suited for both applications and systems program- 
ming, C's popularity has prompted the development of a standard to 
further enhance the language's portable syntax. Jim Brodie, chairman 
of ANSI's C Programming Language Standards Committee, discusses 
the history behind the standardization effort, the goals and working 
principles of the committee, and how the language currently being 
defined is different from the de facto, Kernighan and Ritchie standard. 

C Instead of FORTRAN? 

by Anthony Skjellum 

Because of FORTRAN'S installed base of users and its limited ability to 
be portable between hardware configurations, it has traditionally been 
the default language for scientific and engineering programming tasks. 
However, despite recent movements in the industry to give FORTRAN a 
face-lift by adding certain structured language constructs, C may better 
answer the need for an efficient, modular, and structured programming 
environment for scientific and engineering projects. 

Programming Macros in C, Part I 

by Alexander 8. Abacus 

In this three-part series, Alexander Abacus presents various methods 
and techniques for using macros to improve C program development 
efficiency. Part I focuses on how to use macros as building blocks for 
parsing command line arguments. In the following two installments, 
we'll see how macros can also be used in debugging large programs 
and as a means for translating the common representation of data into 
different but related tables required by different programs. 

C to Assembly Interface 

by Brian H. Burger 

When programming large, complex projects, it often becomes neces- 
sary to access architecture-dependent machine capabilities to increase 
program speed and efficiency. Yet to some programmers, the C lan- 
guage can open a Pandora's box since it requires more knowledge of 
the machine than most other languages. 



DEPARTMENTS 



26 



33 



43 



49 



Publisher's Notes. 
Feedback 



CrossXthoughts 

A new column on programming methods and techniques 

Designers Debate. 

UNIX on micros 

ComputerVisions . 



P.J. Plauger reflects on the history of C 

Exotic Language of the Month Club 

MUMPS: A multi-user, data management language 

Product Bingo . 



New product announcement column 
Software Review 



Special COMPUTER LANGUAGE C compiler analysis 
Advertiser Index 



5 

9 

13 

17 

21 

61 

71 

73 

104 





Windows With A View 
Toward The Future 

The Window 
Machine'" occupies 
only 12K! Written in 
tight, fast Assembler, 
it performs like a 
racing engine . . . with 
more power than 
you'll probably ever 
need. Yet, it's an 
engine designed to fit 
in the vehicle of 
your choice. ..from a 
"stripped-down" 
12BK IBM PC to a 
fully loaded AT. The 
programs you write 
today will run on 
the broadest range of 
machines possible... 
now. and in the 
future. 

Windows Bigger 
Than Your Screen? 

Here's where the 
VSI part of our name 
fits in, VSI means 
Virtual Screen Inter- 
face. Behind each 
window, there's a 
much bigger picture. 
VSI defines virtual 
screens rather than just windows. The 
window itself shows whatever portion of 
its virtual screen you wish to exhibit at 
any given point in your program. Each 
screen can be up to" 128 x 255 (columns x 
rows, or rows x columns). And there are 
more than 100 screen primitives at your 
command. 

Multilingual Windows 

You can order The Window Machine 
with the language interface of your choice: 
C, Pascal, Compiled Basic, Fortran, Cobol, 
or PLl. We've even recently completed 



These are 
coders' 
windows... 
designed to be 
built into the 
programs you 
are writing. 
They can 
overlap, move 
anywhere on 
the screen, 
grow, shrink, 
vanish or blink. 
They can be 
bordered in 
anything from 
asimpieh'neto 
flashing 
asterisks. ..or 
even no border 
at all. And 
you can have 
up to 255 of 
them at a time.' 
CoJor or 
monochrome 
...of course! 



Why did Simon & 
Schuster, 3Com, 
Tymshare, and 
Revlon choose 
VSI-The Window 



figured if you wanted ribbons and bows 
you could always add them yourself.) 

And by offering you the product our- 
selves, we were able to cut out all the 
middlemen and save you a tremendous 
amount of money. 



SI 



The Window 
Machine 1 " 



/Kmlafjlt fur thi> IBM «:. XT, AT. IBM Compatibles, 
nncl the Wans. T '- '"' l5ft 

The Window Machine Includes: 



and how come 
you can buy it for 
such a low price? 



$59.95 



• Zoom Windows 
Multiple Virtual 
Screens fup to 255J 
i Choice of Borders 
(including flashing borders] 
■ Support for all Color and 
Monochrome Video Attributes 
(no graphics cord required) 
Built-in Diagnostics 
■ And much, much more 

ORDER YOUR COPY OF 

VSI— THE WINDOW MACHINE TODAY 

For Visa and MasterCard orders call toll 

free: 

1-800 742-2500 




an interface for Turbo Pascal*, so that 
now true, full-featured windowing can be 
utilized with this fine compiler. [Turbo's 
own built-in "windowing" procedure is 
extremely limited). 

Windows That Won't Break You 

We decided to save you a lot of money. 
So. we left behind fancy binders, monn- 
grammed slip cases and plastic pre- 
sentation boxes. Instead, you'll find an 
extremely powerful tool and a 200 page 
manual written with an eye toward 
simplicity, clarity and completeness. (We 

'Tufoo Pascal is a Trademark of Borland International 



The MiadoM Machine'' SS9 95 Shipping and handling included 

LANGUAGE ICTEWACE: 
□utllctC -Healia Cobol DMicrcsofl Basic Ccfnpikf U Micrasoll Fortran 
T PLl CMttrosoll Pascal LTTurbo Pascal [fullteaturd true windotnriBl 

COMPUTES 







Citf 




^IsU ?ip Hut. 


□ ChetL CMoney Order 


□VISA 


MasterCard 


Or! l 




Pip Hjl* 



'CaWormi* rKidenis lax included. Orders ojtsidt Ihe ISA: pi"** add Si 
■■ i jhipp 1 r .'. ■■:■.: h .in-:' r: . 

' AMBEB SYSTEMS 
1171 S Saratoga-Sunnyvale Road 
San lose, CASStiS 



i 



AMBER SYSTEMS, INC. 1171 S. Saratoga-Sunnyvale Road. San Jose CA 95129 



TOR DEALER INQUIRIES: CALL OUR 80 D NUMBER 



CIRCLE 2 ON READER SERVICE CARD 



4 COMPUTER LANGUAGES FEBRUARY I9B5 



Publisher's 
Notes 



Wi 



' elcome to our 
first theme 
issue! This 
month we spotlight the C programming 
language. 

The amount of reader interest and 
increased popularity of C made the sub- 
ject choice of this issue an easy one. The 
C language has endured the evolutionary 
process that any new language must 
undergo when its followers attempt to 
gather industry-wide acceptance for the 
use of Ihcir language. After the past 15 
years or so since its birth at Bell Laborato- 
ries, C is regarded today as perhaps the 
premier language for systems and applica- 
tions programming because of certain 
built-in features such as the portability of 
source code, its simple but structured syn- 
tax, and its machine-level interface 
capabilities. 

How much more popular will C be- 
come? According to P.J. Plauger, involved 
with the early development of C at Bell 
Labs, C's popularity is just short of peak- 
ing. (Sec editor Craig LaGrow's inter- 
view with Plauger in ComputerVisions.) 

A real highlight in this issue is our 
comparative analysis of 21 C compilers— 
nearly every C compiler now on the 
market. This is the most complete and 
objective (no re-run press releases here!) 
C review any magazine has ever published. 

We established a four-man team of C 
experts who judged the compilers on 
objective technical criteria, comparing the 
compilers on the basis of four benchmark 
timing programs and a close analysis of 
their features. This consumer report kind 
of approach seems to be the fairest 
method of comparison possible, but I'm 



sure we'll receive a healthy amount of dis- 
agreement about the results. Let's just 
keep it down to idle threats— no physical 
harm, please! 

Another important feature in this C 
theme issue is a special report from the 
chairman of the C Programming Lan- 
guage Standards Committee, Jim Brodie, 
on the history and current status of the C 
language standardization effort. 

This issue also introduces a new col- 
umn by Namir Shammas entitled 
CrossXthoughts. Look to this column for 
lively discussions on topics like program- 
ming techniques, algorithms, and prac- 
tical solutions to complex programming 
problems. 

I also want to announce our plans to 
sponsor a special seminar and workshop 
on the C programming language to be 
held in Cambridge, Mass., in September 
1985. We're just setting up this event now 
and would appreciate any suggestions you 
might have. If you're interested in getting 
more information about this special event, 
please fill out the coupon on page 1 1 and 
send it in today. Additional details about 
the seminar will be released in upcoming 
issues. 

This issue is a mini celebration of 
sons— it's COMPUTER LANGUAGE'S 
half-year birthday. After only six issues, 
we're selling over 30,000 copies every 
month. Thanks for the great support. 

Finally, remember COMPUTER 
LANGUAGE is not a cheerleader for any 
language. All Modula-2, Forth, COBOL, 
BASIC, etc., fanatics, you'll have your 
month too! 

Cheers! 



COMPUTER 





Carl Landau 

Publisher 



Telecommunicate to COMPUTER LANGUAGE 

COMPUTER LANGUAGE has established two bulletin board systems for you to 
upload and download text and binary programs, as well as to leave your own elec- 
tronic Letter to the Editor. All the program listings referred to in every issue of the 
magazine will be available here. 

In addition, COMPUTER LANGUAGE has its own Special Interest Group on Com- 
puServe's national data base. After calling into your local CompuServe node, simply 
type "GO CLM" al any prompt and you'll be in our SIG. 

To access our bulletin board, set your computer or terminal to the following param- 
eters: 8 data bits, no parity, I stop bit, full duplex, and either 300 or 1200 baud. The 
telephone number is (415) 957-9370. After your modem makes the connection, type 
RETURN several times, and everything else is easy. 

Both systems are open 24 hours per day, 7 days per week. Due to the heavy number 
of callers, please do not log into the system more than one time per day. Messages left 
on either system will be combined the following day. 



LANGUAGE 



EDITOR 

Craig LaGrow 

MANAGING EDITOR 

Regina Starr Ridley 

TECHNICAL EDITOR 

John Halamka 

EDITORIAL ASSISTANT 
Hugh Byrne, Lorilee Biernack! 

CONTRIBUTING EDITORS 

Doug Millison, Namir Shammaj, Ken Takara, 
J.EdwardVolkstorfJr. 

INDUSTRY NEWS CONSULTANT 

Bruce Lynch 

ADVERTISING SALES 

Jan Denle 

CIRCULATION COORDINATOR 

Reriato Sunico 

ART DIRECTOR 

Jeonne Schacht 

COVER PHOTO 

Dow Clement Photography 

PRODUCTION ARTIST 

Anne Doering 

PRODUCTION 

Barbaro Luck, Steve Campbell, Kyle Houbolt 

TECHNICAL CONSULTANT 

Addison Sim$ 

MARKETING CONSULTANT 

Steve Rank 

ACCOUNTING MANAGER 

Lauren Kalkstein 



PUBLISHER 

Carl Landau 

COMPUTER LANGUAGE is published monthly by COM- 
PUTER LANGUAGE Publishing Ltd., 131 Townsend St., 
San Froncisce, CA 94)07. (415) 957-9353, 

Advertising: For information on ad rales, deadlines, and 
piaceme/ir, contact Carl Landau or Jan Dente at (415} 
957-9353, or write to: COMPUTER LANGUAGE, 13! 
TownsendSt., Son Francisco, CA 94107. 

Editorial: Please address all letters and inquiries to: Craig 
LaGrow, Editor, COMPUTER LANGUAGE, 131 Townsend 
St., Son Francisco, CA 94107, 

Subscriptions: Contact COMPUTER LANGUAGE, Sub- 
scriptions Dept., 2443 Fillmore St., Suite 346, Son Fran- 
cisco, CA 94715. Single copy price: S2.95. Subscription 
prices: S24.95 per year (U.S.J; 530. 95per year (Canada 
and Mexico). Subscription prices far outside the U.S., 
Canada, and Mexico: S36.95 (surface mail,!, $54.95 (air 
mail) — U.S. currency only. Please allow six weeks lor new 
subscription service to begin. 

Postal information: Second-closs postage rate is pending 
at Son Francisco, CA and additional moiling offices. 

Reprints: Copyright 1984 by COMPUTFP. LANGUAGE 
Pub/ishingifd. All rights reserved. Reproduction of mate- 
rial appearing in COMPUTER LANGUAGE is forbidden 
without written permission. 

Change of address: Please allow six weeks for change of 
address to late effect. POSTMAST£R:Sendcbonge of ad- 
dress (Form 3579) to COMPUTER LANGUAGE, 131 
TownsendSt., San Francisco, CA 94107. 

COMPUTER LANGUAGE is a registered trademark 
owned by the magazine's parent company, CL Pubiica- 
tions. ANmoteriQl published inCOMPUTER LANGUAGE 
is copyrighted C 1984 by Ct Pub/icafions, Inc. AH rights 
reserved. 






NEW from BORLAND! 

TURBO TOOLBOX & TURBO TUTOR 



4KMtwtE 



\ \~^ 




"TURBO is rauc_ 
Pascal IBM sells." 

Jerry Pournelle, 
Byte, July 1984 

"TURBO PASCAL appears to violate 
the laws of thermodynamics. 

You won't find a comparable price/ 
performance package anywhere. It 
is simply put, the best software deal 
to come along in a long time. If you . 
have the slightest interest in 
Pascal. . .buy it." 

Bruce Webster, 
Softalk IBM: March 1984 












y x 



3?.. 



BORLAND 

INTERNATIONAL 

GIFT PACK 



$9995 

A SAVINGS OF $30! 



What a gift for you and your friends! The extraordinary TURBO PASCAL 
compiler, together with the exciting new TURBO TOOLBOX and new TURBO 
TUTOR. All 3 manuals with disks for $99.95. 

PASCAL Version 2.0 (reg. $49.95). The now classic program 
development environment still includes the FREE MICROCALC SPREAD SHEET. 
Commented source code on disk 

• Optional 8087 support available for a small additional charge 

NEW! 1 OLBOX (reg. $49.95). A set of three fundamental 

utilities that work in conjunction with TURBO PASCAL. Includes: 

• TURBO-ISAM FILES USING B+ TREES. Commented source code on disk 

• QUIKSORT ON DISK. Commented source code on disk 

• GINST (General Installation Program) 

.Provides those programs written in TURBO PASCAL with a terminal installation module 
just like TURBO'S! 

• NOW INCLUDES FREE SAMPLE DATABASE . . . right on the disk! Just compile 
it, and it's ready to go to work for you. It's a great example of how to use TURBO 
TOOLBOX and. at the same time, it's a working piece of software you can use 
right away! 

NEW! 1 TUTOR (reg. $29.95). Teaches step by step how to use the TURBO 

PASCAL development environment-an ideal introduction for basic programmers. 
Commented source code for all program examples on disk. 

30 DAY MONEY BACK GUARANTEE Available at your nearest software dealer. 

For VISA and MASTERCARD order call toll free: l-(SOO)-255-800S l-(800)-742-1133 

(Lines open 24 his.. 7 days a week) Dealer and Distributor inquiries welcome (408) 438-8400 

CHOOSE ONE (please add $5.00 for handling and shipping U.S. orders) 

All Three-Gift Pack $ 99.95 + 5.00 SPECIAL! Turbo Toolbox $49.95 + 5.00 

All Three & 8087 139.95 + 5.00 SPECIAL) Turbo Tutor 29.95 + 5.00 

Turbo Pascal 2.0 49.95 + 5.00 Turbo 8087 89.95 + 5.00 

Check Money Order . VISA . MasterCards 

Card #: 

My system is: 8 bit 16 bit 

Operating System: CP/M 80 CP/M 86 MS DOS PC DOS 

Computer: Disk Format: ^___ 

Please be sure model number & format are correct. 

NAME: 

ADDRESS: . ^__ 

CITY/STATE/ZIP: 

TELEPHONE: 



Exp. date: 



Shipped UPS 



California residents add 6% sales tax. Outside U.S.A. add $15.00 (if outside of U.S.A. payment must be by bank draft payable in 
the U.S. and in U.S. dollars! Sorry, no CO.D. or Purchase Orders. „„ 

20 



t BORlflflD 

9) INTERNATIONAL 



4113 Scotts Valley Drive 
Scotts Valley, California 95066 
TELEX: 172373 



CIRCLE 6 ON READER SERVICE CARD 




>«tec The Most Powerful C 



for the IBM AT • MACINTOSH • MS DOS • CP/M-80 • ROM APPLICATIONS 
IBM PC/XT • APPLE // • CP/M-86 • TRSDOS • CROSS DEVELOPMENT 



Why Professionals Choose Aztec C 

AZTEC C compilers generate fast, compact 
code. AZTEC C is a sophisticated development 
system with assemblers, debuggers, linkers, 
editors, utilities and extensive run time libraries. 
AZTEC C is documented in detail. AZTEC C is 
the most accurate and portable implementation 
of C for microcomputers. AZTEC C supports 
specialized professional needs such as cross 
development and ROM code development. 
MANX provides qualified technical support. 

AZTEC C86/PRO 
— lor the IBM AT and PC/XT 

AZTEC C86/PRO provides the power, portabili- 
ty, and professional features you need to 
develop sophisticated software for PC DOS, MS 
DOS AND CP/M-86 based microsystems. The 
system also supports the generation of ROM 
based software for 8088/8086, B0186, and 80286 
processors. Options exist to cross develop ROM 
code for 65xx, 8080, 8085, and Z80 processors. 
Cross development systems are also available 
that target most micro computers. Call for infor- 
mation on AZTEC C86/PRO support for XENIX 
and TOPVIEW. 



POWERFUL — AZTEC C86/PRO 3.2 outper- 
forms Lattice 2.1 on the DHRYSTONE 
benchmark 2 to 1 for speed (17.8 sees vs 37.1) 
while using 65% less memory (5.8k vs 14k). The 
AZTEC C86/PRO system also compiles in 10% 
to 60% less time and supports fast, high volume 
I/O. 



PORTABLE — MANX Software Systems pro- 
vides real portability with a family of compatible 
AZTEC C software development systems for PC 
DOS, MS DOS, CP/M-86, Macintosh, CP/M-80, 
APPLE // + ,//e, and He (NIBBLE -4 apple rating), 
TRSDOS (80-MICRO - 5 star rating), and Commo- 
dore C64 (the C64 system is only available as a 
cross compiler - call for details). AZTEC 
C86/PRO is compatible with UNIX and XENIX. 



PROFESSIONAL — For professional features 
AZTEC C86/PRO is unparalleled. 

• Full C Compiler (803618086 ■ 80186 ■ B0286I 

• Macro Assembler lor 808818086(80186/80206 

• Linkage Editor with ROM support and overlays 

• Run Time Libraries - object libraries + source 
DOS 1.x; DOS 2.x; DOS 3.x; screen I/O; Graphics; 
UNIX I/O; STRING; simulated float; 8087 support; 
MATH; ROM; CP/M-86 

. Selection of 8088(8086. 80186. or 80286 code genera- 
tion lo guarantee best choice for performance and 
compatibility 



• utility to convert AZTEC object code or libraries to 
Microsoft format. {Assembly + conversion takes 
less than half the time as Microsoft's MASM to pro- 
duce MS object) 

• Large memory models and sophisticated memory 
management 

• Support products lor graphics, DB, Screen, & ... 

• ROMablecode + ROM support + separate code and 
data + INTEL Hex Converter 

• Symbolic Debugger & Other Utilities 

• Full Screen Editor (like Vi) 

• CROSS Compilers are available to APPLE //, Macin- 
tosh, CP/M-80, TRSDOS, COMMODORE C64. and 
ROM based 65xx, and 808O/BOB5/Z8O 

• Detailed Documentation 

AZTEC C86/PRO-AT $500 

(configured for IBM AT - options lor 8088/8086) 

AZTEC C86/PRO-PC/XT $500 

(configured tor IBM PC/XT . options for 80136/80286) 

AZTEC C86/BAS includes C compiler (small model only), 
8086 MACRO assembler, overlay linker, UNIX, MATH, 
SCREEN, and GRAPHICS libraries, debugger, and 
editor. 

AZTEC C86/BAS $199 

AZTEC C86/BAS(CP/M-86| $199 

AZTEC C86/BAS (DOS + CP/M-86) S299 

UPGRADE to AZTEC C86/PRO S310 

C-TREE Database with source $399 

C-TREE Database (object) .$149 

CROSS COMPILERS 
Cross Compilers for ROM, MS DOS, PC DOS, or CPIM-86 
applications. 

VAX - > 8086/BOxxx cross S5000 

PDP-11 ->8086/80xxx cross $2000 

Cross Compilers with PC DOS or CP/M-86 hosts are $750 
lor the first target and $500 tor each additional target, 
Targets: 65xx; CP/M-80; C64; 8080/8085/ZBO; Macintosh; 
TRSDOS; 8086/80B8/801 86/80286; APPLE //. 



AZTEC C68K 

— for the Macintosh 

For power, portability, and professional features 
AZTEC C68K-C Is the finest C software development 
system available tor the Macintosh. 

The AZTEC C6BK-C system includes a 68000 macro 
assembler, a linkage editor, a source editor, a mouse 
based editor, a SHELL development environment, a 
library of UNIX I/O and utility routines, lull access and 
support of the Macintosh TOOLBOX routines, debug- 
ging aides, utilities, make, diff, grep, TTY simulator with 
upload & download (source supplied), a RAM disk (tor 
512K Mac), a resource maker, and a no royalty license 
agreement. Programming examples ar included. (Over 
600 pages of documentation). 

AZTEC C68K-C requires a 128K Macintosh, 
and two disk drives (frugal developers can make 
do with one drive). AZTEC C68K supports the 
512K Macintosh and hard disks. 

AZTEC C6BK-C (commercial system) $500 

AZTEC C68K-p (personal system) $199 

AZTEC C68K-P to AZTEC C68K-C upgrade $310 



Mac C-lree database $149 

Mac C-tree database with source $399 

Lisa Kll (Pascal to AZTEC C68k object converter) . .$ 99 



AZTEC C65 

— lor the APPLE // 

"...The AZTEC C-system Is one ot the finest software 
packages I have seen..." NIBBLE review. July 1964, 

The only commercial C development system available 
that runs native on the APPLE II + , He, and lie, the 
AZTEC C65 development system includes a lull floating 
point C compiler compatible with UNIX C and other 
MANX AZTEC C compilers, a 6502 relocating assem- 
bler, a linkage editor, a library utility, a SHELL develop- 
ment environment, a full screen editor, UNIX I/O and 
utility subroutines, simple graphics, and screen func- 
tions. 

AZTEC C65 (Apple DOS 3.3) $199 

AZTEC C65/PRO (Apple DOS + ProDos) $350 

(call for availability) 



AZTEC C ll/PRO 

— lor CP/M-80 

The first member of the AZTEC C lamily was the 
CPiM-BO AZTEC C compiler. It is "the standard" com- 
piler for development on CP/M-80. The system includes 
the AZTEC CMC compiler, an 8080 assembler, a linkage 
editor, an obiect librarian, a full library of UNIX I/O and 
utility routines. CP/M-80 run time routines, the SMALL 
library (creates modules less than 3K In size), the fast 
linker for reduced development times, the ROM library, 
RMAC and M60 support, library source, support for 
DRI's SID/ZSID symbolic debugger, and more, 

AZTECC ll/PRO $349 

AZTEC CII/BAS $199 

C-TREE Database with source $399 

C-TREE Database in AZTEC object form $149 



AZTEC C80 

— lor TRSDOS (Radio Shack Model HI * 4( 
•7 ve had a lot ot experience with ditterent C compilers, 
but the Azlec C80 Compiler and Professional Develop- 
ment System is the best I've seen." 80-Micro. Decem- 
ber, 1984, John B. Harrell lit 

This sytem has most of the features ot AZTEC C II lor 
CP/M. II is perhaps the best software development 
system lor the Radio Shack Model III and IV. 

AZTEC CB0 model 3 (no floating point) $149 

AZTEC CB0 model 4 (lull) $199 

AZTECC80/PRO(lulltormodel3and4) $299 



To order or for information call: 



MANX ® 



.ill 



1-221-0440 

(20 1) 530-7997 (NJ and outside U.S.A.). Or wrlle: MANX 
SOFTWARE SYSTEMS, P.O. Box 55, Shrewsbury. N.J 
07701. 



SHIPPING INFORMATION ■ Standard U.S. 
shipment Is UPS ground (no fee), In the U.S. 
one day shipment is $20. two days is $10. 
Canadian shipment is $10. Two days ship, 
ment outside she U.S. is by courier and is 
freight collect. 



TRS B0 RADIO SHACK TRS DOS is a trademark Of TANDY. 
APPLE DOS MACINTOSH is a trademark ot APPLE. 



For Technical Support 
(Bug Busters) call: 201-530-6557 

CIRCLE 69 ON READER SERVICE CARD 



FEEDBACK 



AC limerick 

Dear Editor: 

C is one of the most versatile languages 
available today. Its ability to add by func- 
tion allows you to create large applica- 
tions. Yet for operating systems or pro- 
cess control, C can "get small" while still 
maintaining good structure. 

As a mildly typed language, C 
impresses some restrictions on the pro- 
grammer but still allows freedom for spe- 
cial situations. I thought your readers 
might enjoy a little program I wrote for 
nonprogramming managers who insist on 
easily readable code (Listing 1). 

Mike Rejsa 
Minneapolis, Minn. 



Correct Ada figure 

Dear Editor: 

For those people who want a correct 
copy of Figure 2 of my article "Learn to 
Think in Ada" (Nov. 1984, pp. 47-49), 
here is a copy (Listing 2). Please apolo- 
gize to our readers for me. I can imagine 
how frustrating it must be to try to figure 
out how a program works when it isn't all 
there. 

Do-Whi!e Jones 
ftidgecresl, Calif. 



*/ 
*/ 



/* A limerick for C programmers 

/* by Mike Rejsa 

#define a 

Idefine and(c) bdos(6, c) 

#define created 

fdefine Dee = 

fdefine had = 

#define it — 

#define thought puts 

#define with - 

int *fame =128, *give =128, *name =128; 

int *Bea = 130, *looking = 130, *to = 130; 

int language = 120; 

main() 

{ 

/* A lady programmer named */ 

*Bea Dee 

created a language 

with 'C; 

while ( — *looking) 

{ 

for (*fame had *to; *give; it a *name) 

and( ' » ); 
thought ( "Is it Bea, C, or Dee?" ); 



Listing 1. 



What was it, exactly? 

As many readers have pointed out, the 
listings in Joe Celko 's "Wiiat Day is ft, 
Exactly" (Dec. 1984, pp. 47-50) contained 
some errors. Here are corrections, by list- 
ing and line number: 

■ Listing 1/line 4: change MOD 400 to 
MOD 100 

■ Listing 2 /line 1: change Validate to 
ValidDale 

line 4: change MinSystemYear to 

MaxSystemYear 

line 11: change MonthSuze to MonthSize 

line 12: change second MinSystemYear to 

MaxSystemYear 

line 13: change Validdate to ValidDate 

■ Listing 3 /line 2: add */ to end of line 
line 8: change IN1T90 to IN1T (0 

line 9: change month > 1 to month > 2 



with C0NS0LE_I0; use CONSOLEJO ; 
procedure Solve_Exercise_3__4__B is 

I, J : integer; 

TEST_RESULT, I_IS_0DD, J_IS_EVEN : boolean; 
begin 

put( "Please enter an integer ""J"" " 

put("Now enter another integer ""J"" 

if I mod 2 = 1 



) ; get(I); new_line; 
"); get(J); new_line; 



then I_IS_0DD ; 

else I_IS_0DD ; 
end if; 
if J mod 2 = 

then J_IS_EVEN 

else J_IS_EVEN 
end if; 

TEST RESULT := I_IS_0DD and J_IS_EVEN; 
put ("The test turned out ") ; put(TEST_RESULT) ; new line; 
end Solve_Exercise_3__4_B; 

Listing 2. 



TRUE; 
FALSE; 



:= TRUE; 
:= FALSE; 




IF (raonth=2) THEN Jul2:= Jul2 + 1 ELSE NULL; 

IF ((month>2) AND (month<9)) THEN Jul2:= Jul2 - 1 ELSE NULL; 




Listing 3. 



IF LeapYear(year) THEN X:=l ELSE X:=2 

Julian:= Truncate(275 * month / 9) - X * Truncate((month+9) / 12) 

Julian := Julian + day - 30; 



Listing 4. 



For vour IBM/PC 



mbp COBOL: 

4 times faster; 
and now witn 

SOKT& CHAIN 



I75Q 



mbp COBOL can be 
summed up in one 
word: fast. 

Because it generates 
native machine language object code, the 
mbp COBOL Compiler executes IBM/PC* 
programs at least 4 times faster (see chart) 



GIBSON MIX Benchmark Results 

( lit ulated S-Proflk' 
tKepresentaltiv COBOL statement mix) 

Execution lime ratio 



mbp Leve! II" 

COBOL COBOL 



LOO 



1.08 



R-M"* 
COBOL 

5.98 



Microsoft* 
COBOL 



6.18 



allow source & object 
code, map & cross- 
reference checking; GSA 
Certification to ANSI '74 
Level II; mbp has it all. 

It's no surprise companies like Bechtel, 
Chase, Citicorp, Connecticut Mutual, and 
Sikorsky choose mbp COBOL; make it 
your choice, too, mbp is available at 
Vanpak Software Centers, or direct. 
For complete information, write mbp 
Software & Systems Technology, 
Inc., 7700 Edgewater Drive, Suite 
360, Oakland, CA 94621, or phone 
415/632-1555 
-today 



12SK syMem wltfi hard disk required "[BM'PC is in IBM TM: "Level [I 
is a Micro Focus TM. ""A Ry^n-McrarUrulTM. *■■■* Microsoft TM. 

Fast also describes our new SORT; which 
can sort four-thousand 128-byte records in 
less than 30 seconds. A callable subroutine 
or stand-alone, 9 SORT control fields can 
be specified. And our new CHAIN is both 
fast and secure, conveniently transferring 
control from one program to another, pass- 
ing 255 parameters. Plus, new extensions to 
ACCEPT & DISPLAY verbs give better, faster 
interactive programming. 

The complete COBOL. An Interactive 
Symbolic Debug Package included standard; 
Multi-Keyed ISAM Structure; listing options 




CIRCLE 39 ON READER SERVICE CARD 
10 COMPUTER LANGUAGE! FEBRUARY 1985 



line 12: change day: to day: 

■ Listing 4/line 2: change * to */ 
line 7: change 30. 475 to 30. 43 75 

line 12: change month > 1 to month > 2 

■ Listing 5 /line 8: change 
CenturyTahk'l 1:121 to CenturyTahlel 1 :5J 
Line 26: change : to : at the end of line 

■ Usting6Vline 12: change EFto IF. 



Calendar modifications 

Dear Editor: 

Lines 8- 1 1 of Listing 4 in Joe Celko's 
"What Day is It, Exactly?" are wrong. 
They might be replaced with the two lines 
in Listing 3. 

An easier approach to the Commercial 
Dale is shown in Listing 4. 

F. Barry Mulligan 
Atlanta, Ga. 



Leap year rule 



Dear Editor: 

I feel I should correct an inaccuracy in 
Joe Celko's "What Day is It, Exactly?" 
The inaccuracy has to do with leap year 
calculations. 

First, in the text of Celko's article he 
states, "... every year divisible by four 
is a leap year . . . there is also a 400-year 
cycle . . . The four-year cycle exists 
because the number of days in a year is 
365 and almost one-quarter days. 
Leap year takes care of the one-quarter 
day, and the 400-year rule takes care of 
the 'almost.' " 

The actual rule is different. The year is 
a little more than 11 min short of 365 days 
and one-quarter. This amounts to being a 
day ahead after about 128 years or about 3 
days ahead in 400 years. The rule is: if the 
year is divisible by 4, it IS a leap year, 
UNLESS, if the year is divisible by 400, it 
IS a leap year. Hence, the year 2000 is a 
leap year. 

Daniel Efron 
St. Louis Park, Minn. 

Author Joe Celko comments: Where 
365. 25 days per year appears , you can 
substitute the more accurate 365.2422 
days per year if the software will not have 
rounding problems in the calculations. 



PROGRAM Math 

PARAMETER (a=l. 43576, b=5. 23417) 

total = 0.0 

DO 10 i = 1, 2500 

c = EXP( L0G( (SQRT(b))**2 ) ) 
d = ATAN( SIN(c)/GOS(c) ) /a 
total = total + d 

10 CONTINUE 

WRITE(*,20) total 

20 F0RMAT( IX, 'Total is: \F11.5) 

STOP 

END 



a/b 



Listing 5. 



PROGRAM Overhead 




PRINT *, 'Finished' 




STOP 




END 





FORTRAN math program 

Dear Editor: 

Your software review of the Digital 
Research FORTRAN-77 compiler (Nov. 
1984, pp. 66-71) was worthwhile but it 
lacked any critical comments. Being 
interested in such a compiler, I visited a 
friend who recently purchased the DRI 
product and is running it on an NEC/APC 
operating under CP/M 86. We entered the 
two programs in Listing 5. 

The resulting statistics for program 
"overhead" are provided: (most of the 
run-time is consumed in reading the 
executable image into RAM) 

Compilation time: 41 sec 
Link time: 5 min 24 sec 
Run time: 16 sec 
Executable file size; 84K 

The math program was compiled 
without options and then linked with the 
HARD8087 option (requires 8087 
coprocessor) and also with the SIM8087 
option (software mathematics), and these 
two executable images were run from a 
RAMdisk. The following statistics are 
provided: 

■ On the 8086 math program, an 
:xecution time of 15 min 15 sec, and a 
result of 2499. 99976 

■ On the 8087 chip, an execution time of 
15.7 sec, and a result of 2499.99976. 

Note that the correct result is 2500. 

Kenneth C. Beaudrie 
Denver, Colo. 




ANNOUNCING . . . COMPUTER LANGUAGE'S 

C Seminar/Workshop 

Cambridge, MASS ■ 

September 1985 

Plans are being set now for COMPUTER LANGUAGE'S C 
Seminar. The 2/2 day event will be held in the fall of 1985 
in beautiful Cambridge. 

Details concerning the topics, speakers and dates wiil be 
announced soon. This seminar will be the most 
comprehensive and practical session ever held about the C 
programming language. 

Become involved in this event from 
the start by filling out this — ■.*"■■* " \ 

c ° upon ,oday: :;"»" *■ -*" wd ' 






bout' 




Send to: COMPUTER LANGUAGE Seminar 
l 3 1 Townsend Street • San Francisco, CA 94 1 07 



11 



WARNING: 
Do NOT read this flowchart: 



it UP ' 





■.cltir' i -* 


_«» 


— 


1 

■ unotlirr 1 ■ -i. * 




■, 










:..fesr..: 


i Y"» 




" CtrtAtn MMAI * 










! 








HO 


„•* pid -.^ 



iifillT 



Att^* to * T« 



riTw 



Unless you have time to spare ... in extreme oases a few people have found 
they had thirty years to spare. 

You read the flowchart anyway. Why? Because flowcharts are a powerful 

graphic way of communicating ideas. The big problem is producing them: 

they take a lot of time to do well and are difficult to revise or correct without 

starling over from scratch. 

The flowchart above was produced using EasyFlow, a computer aided 

flowchart generation tool. You decide how the flowchart is to be laid out 

and describe the flowchart to EasyFlow using a simple command 

language. EasyFlow then does the hard part of actually producing and 

printing the flowchart. 

EasyFlow is a well designed, thoroughly tested and comprehensively 

documented package, 

• Fast. EasyFlow is written in assembly language for speed. It produces 
a typical flowchart in 12 seconds. 

• Easy.The EasyFlow flowchart description language is straightforward 
and easy to learn. 

• Printers. EasyFlow works with all printers. Extensive printer control 
facilities allow you to fine-tune EasyFlow to produce the best possible 
flowcharts on your particular printer. 

• Shapes. EasyFlow comes with eighteen standard flowcharting shapes. 
User defined shapes can be easily added. 

• Lines. User definable line-drawing characters allow EasyFlow to adapt 
to personal preference and printers with graphic line characters. 

• Manual. Complete, comprehensible and over 100 pages long. Also in- 
cluded is a quick reference card, a planning grid and ten demo 
flowcharts (demo flowcharts supplied on disk as well). 

(U.S. funds) Check, money order, Visa or company RO. 

HavenTree Software Limited 



$49.95 

EasyFlow is available for MS-DOS/PC- 
OOS machines (96K or greater) on IBM 
PC format 5" diskettes. Available for 
CPfM-80 machines (48K or greater) on 8" 
SSSDand most soft sectored 5" formats. 



R.R. #1, Suite 100 
Seeley's Bay, Ontario 
Canada, KOH 2N0 
(613) 542-7270 



CIRCLE 41 ON READER SERVICE CARD 
12 COMPUTER LANGUAGES FEBRUARY 1985 



MULTI-BASIC 

The Compatible BASIC Compiler from Alcor 
(Supported Features Chart) 





JFELSE/FQfiNEXT 
WH.LEWEN0 
OPEN /CLOSE 






• 

•- 
ft 


'* ' * 

* ft 

• ft 


CREATE/DELETE 
PRINT/ PRINT USING 
LPRINT/LPAINT USING 






• 
• 


• * 

ft • 


PRINT @ 
INPUT/LINE INPUT 

input (t/une input K 






• . 


• ft 


BEAD #/READ# LINE 
LOC/IOF/EOf/ERROR 
FIELD/GET/PUT 






• 


• ft 


RSET/LSE17ERASE 
MKD$/MKfS/MK5$ 
CVi/CVS/CVD/SPC 










READ/DATA/ RESTORE 

TROM/TROFF 

OEFFN/RAN00M/RND 






ft 


:•■■ ■ * 


DEF USft/SWAP/WAIT 
CALL {ASSEMBLY LANG) 
DEFSTR/DBL/3NG/INT 










DOUBLE/REAL 

INTEGER/STRING 

G0TO/GOSUB 






* 
• 
• 




ON ERROR SOTO 
RESUME/RESUME NEXT 
EJtL/ERR 










ON number GOTO/GOSUB 

NAME/ftENAME 

PEErOPOKE/mP/OUT 




* 
* 
• 


• 
* 




SYSTEM/SOUND 

SADD/MATCH/UCASES 

VAL/TAB/STRS/VARPTR 




* 


* 
• 




STN/C0S/TAN/ATN 
10G/EXP/ABS/SQR 
COMMANDS/IF END 




• 
• 


ft 
• 
• 




INKEY$/INPUT$ 

TIMES/OATE5/HEXV0CTS 

STRWGS/SPACES 




« 

* 
* 




* 


LEFTS/RSHTS/MIDS 
CHRS/ASCfLEN/SGN 
OPTION BASE 




* 
• 


* ■ 
* 


* * 


R0W/POS/LPOS 

DIM/MEM/FRE 

M0D/MFRE 




• 


• 


• • 


GET/PUT (CHARACTER) 

KILL/CLS/ClEAR/fNSTR 

mT/RX/CtNT 




• 
* 


* 


. * * 


CSNG/CD8L 

CHAIN 

C0N5TABWCONCHAR% 




■ 


* 
ft 


• ft 

* • 


C0NS0LE/LPRINTER 
BINARY RANDOM FILES 
ASCII RANDOM FILES 




• 


* 
• 


* « 

• • 


255 CHARACTER NAMES 
REDIWENSfONED ARRAYS 
UNLIMITED STRING SIZE 






* 


* - * 


MULTI LINE FUNCTIONS 
PROCEDURES/RECURSION 
FUNCTION TRACING 






• 


ft ft 


LOCAL VARIABLES 
NESTED FUNCTIONS 
OPTiONAL LINE NUMBERS 






* 
* 


* • 

• ft 


DESCRIPTIVE LABELS 
SINGLE PRECISION 
DOUBLE PRECISION 
LINK TO PASCAL &C 


• 
• 


■ 


* 
• 


• ft 



For TRSBO models I, II, III, 4, 12, or 2000 using TRSDOS, 
CP/M, or MSDOS and lor IBM PC using PCDOS 
Multi-Basic, Pascal, or C $139 
Add shipping $6.00 USA, $28 Overseas 



ALCORB 



13534 Preston Road. Suite 365 
Dallas. Texas 75240 
(214)238-8554 



'.'i.i-.-Ei.ii.L n, .1 trademark a! Alcor Systems 

TflSDOS TRSBO a a registered liademarli ol Tandy Corporation 

CP/M. CBAS'C are i'aaemart.5 g! Digilal Research 

MSDOS MBASIC are Haaemartj q! Mhcreiofi 

CIRCLE 1 ON READER SERVICE CARD 



crossXthoughts 




Pseudocode syntax 



By Namir Shammas 



Wi 



leonte to 
CrossXthoughts! 
It is a 

new column for all programmers and a 
platform for sharing algorithms and pro- 
gramming development techniques and 
solutions. 

We will cover a wide variety of sub- 
jects, such as data management tech- 
niques, interpreters, graphics, and arti- 
ficial intelligence. 1 will be using the 
COMPUTER LANGUAGE Bulletin Board 
Service (415 957-9370) and CompuServe 
to interact with readers (but ordinary mail 
is not completely ruled out!). These media 
will be used for topic selections, follow- 
up discussion on published columns, 
questions asked by readers, and sharing 
expert opinions and experiences. 

In addition, the column will assist read- 
ers with similar interests in contacting 
each other. This will allow further dis- 
cussion and exchange and published 
follow-up. I will maintain SIG lists con- 
taining names, addresses, phone num- 
bers, etc. They will be posted on the bul- 
letin boards and also made available 
through COMPUTER LANGUAGE by 
written requests. Putting your name on a 
particular SIG list is done at your request, 
by writing or through the BBS and Compu- 
Serve. The column will also carry out 
mini-contests awarding books, software 
packages, and subscriptions in the 
magazine. 



T 



o make this col- 
umn a crossroad 
for programmers 
who use different languages, I will be 
using pseudocode listings frequently. 
Pseudocode is also this issue's topic. 

To insure good readability and a degree 
of consistency I am suggesting a syntax 
for the Programmers' Pseudo Listing 
(PPL). I have loaded it on a BBS file 
called NILE, which contains an applica- 
tion program written in Turbo Pascal and 
the documentation for using it. It checks 
the PPL syntax and helps in top-down 
software design process allowing devel- 
opment from general to specific. 

Additional advantages gained from 
jsing the PPL are: 

■ During software development it is eas- 
cr and faster to alter and update text than 
it is to change flowcharts. 



■ The PPL offers programmers flex- 
ibility in sharing information. One can 
generalize certain code segments to either 
spare the other party irrelevant code or 
deliberately hide detailed algorithms to 
protect programming tips and tricks. 

■ To assist top-down software design. 

■ To assist applications development in 
more than one language or from one to 
another. 

The implementation of a standard PPL, 
just like any language, is subject to certain 
syntax and rules. They are of course much 
more flexible than those for formal lan- 
guages. Deviating from them is by no 
means a sacrilege. The general rules are: 

■ Data types and identifiers. This is the 
area where languages differ greatly. The 
PPL will leave the choice of how 

to present data structures up to the 
programmer. 

■ Labels. The aim of structured lan- 
guages is to move away from using labels 
and GOTOs. It is worth pointing out that 
Modula-2 has not implemented the GOTO 
statement at all! By contrast, Ada and C 
allow : using the GOTO especially for 
exiting deeply nested loops. Therefore, 
labeled GOTOs are allowed. This should 
benefit those who program in BASIC and 
FORTRAN. However, I must say- 
following the example of nonsmoker 
signs— "Thank you for not GOTOmg]" 

■ Loops. There are two basic types of 
loops. The first has a loop counter with 



General loop construct 



starting and ending values— the code in 

the loop is repeated a fixed number of 
times. This is the famous FOR-DO loop in 
Pascal and Modula-2 or the FOR-NEXTin 
BASIC. 

The second loop type would execute the 
enclosed code depending on the success of 
a conditional test. When the test is located 
at the beginning of the loop, we have the 
WHILE-DO, as in Pascal, Modula-2, C, 
and FORTRAN 77. When the test is car- 
ried out at the end of the loop, forcing 
execution of the code at least once, we 
have the REPEAT-UNTIL effect. The test 
can also be carried out anywhere inside 
the loop in an attempt to exit. This is 
equivalent to the LOOP-EXIT'm Ada and 
Modula-2. 

From the preceding we can see that the 
different loop types can be presented 
basically as shown in Listing 1. The /A7- 
TIALIZE will remind the programmer of 
any loop initializations; I suggest its pres- 
ence be mandatory. The word "None" 
should be used when no action is needed. 
The LOOP keyword is followed by an 
optional loop name. The latter is useful to 
keep track of exiting nested loops (actu- 
ally, it is an Ada feature). 

The loop BEGIN may contain informa- 
tion to indicate the use of a counter or a 
conditional test to simulate the WHILE- 
DO construct. The conditional test can be 
inserted inside the loop code or at the end. 
The latter will simulate the REPEAT- 



INITIALIZE <optional set-up> 

LOOP <optional name> 

BEGIN <no text to simulate REPEAT-UNTIL> or 

<declare loop counter> or 

<0ptional test here to EXIT <optional name> > 

loop code with optional test to EXIT <optional name> 

Optional test here to EXIT <optional name> 

END LOOP 

TERMINATE resolve any pending operations 

Listing 1. 



13 



UNTIL construct. The END LOOP token 
need not be followed by a loop name since 
we expect loops to be logically nested. 
The TERMINATE key word is used to indi- 
cate the action taken to resolve pending 
data treatment after the loop ends. 
■ Conditional branching. Inspired by 
languages like C, Pascal, Modula-2 and 
Ada, I use two types of conditional bran- 
ching constructs: 

1 . The well-known IF-THEN construct 
with ELSE and ELSEIF clauses for more 
elaborate decision-making. Listing 2 
shows the two alternatives when using the 
IF-THEN clauses. 

2. The CASE test is applied when an 
identifier can be used as a switch to select 
the appropriate course of action. Listing 3 
shows the construct for CASE . The 
WHEN and OTHERWISE keywords will 
indicate the beginning of a new CASE 
option and the end of a previous one, 
except for the first WHEN. 



IF-THEN constructs 


IF <Test 


is true> 




THEN 










Outcome 


# 1 


ELSE 










Outcome 


# 2 


END IF 








and 








IF <Test 


1 is true> 


THEN 








Outt 


;ome 


# 1 




ELSEIF <Test 


2 is 


true> 


THEN 








Outcome 


# 2 




ELSEIF <Test 


3 is 


true> 


THEN 








Qut< 


;ome 


# 3 




ELSE 








Outi 


sortie 


# 4 




END IF 









Listing 2. 



I 

1 




■ Procedures, and functions. Due to the 
use of plain English words to describe the 
action taken, we must be able to point out 
specific calls to procedures and functions. 
I suggest that the procedure names be 
enclosed in brackets and function names 
in braces. The following example shows 
how a call to a procedure SOLVE is 
documented: 

Set up simulataneous equation and 
[SOLVE] 

Another example is a call to a logical 
function DiskFull : 

IF (DiskFullJTHEN warn the user that 
no space is left 

Since the PPL may be involved in early 
software development stages, the proce- 
dure and function declarations follow the 
main code portion. This allows for a top- 
down software design. Thus, procedures 
and functions that are called more often 
would be located further down in the list- 
ing. To declare the code for a procedure 
or function, it is sufficient to use the key- 
words PROCEDURE or FUNCTION fol- 
lowed by a name. 

■ Input/Output. This is another aspect of 
programming where different languages 
as well as dialects implement differently. 
We will adopt the following commands: 

DISPLAY < list > for screen output 
INPUT < list > for keyboard input 
PRINT < list > to send output to a 

printer. 

File I/O involves reading and writing of 

data records. The first command needed 

by all file I/O is to open it: 

OPEN < filename > , < buffer name or 
number >,< mode > 

where the I/O mode is one of the 
following: 

INPUT for data input 

OUTPUT for data output 



CASE construct 
CASE <identifier> 



APPEND to append output data to the 
existing file 

RANDOM for random data read and 
write. 

Its counterpart is CLOSE < buffer name 
or number > to close the file. 

For sequential I/O we have READ 
< buffer > , <data > to input data, 
WRITE < buffer > , < data > to output. 
For random I/O we have READ 
< buffer > , < record # > , < data > and 
WRITE < buffer > , < record M > , 
<data > to read and write, respectively. 
The SEEK < buffer > , < record > is used 
to position record pointers to a specific 
location. 

Port communications is carried out in a 
similar way to file I/O except the modes 
allowed are, obviously, INPUT and 
OUTPUT. 

■ Incrementing, decrementing and 
scaling variables. These operations are 
used extensively in all languages. Some, 
like C, offer a shorthand way of stating 
them. I am adopting the C notation. This 
is useful in shortening code lines since 
long variable names would most likely be 
used for clarity. To increment a variable: 

Variable + = Added number 

which is equivalent to 

Variable = Variable + Added number 

and to decrement a variable: 

Variable - = Subtracted number 

Similarly, scaling a variable by multi- 
plication or division, as in 

Variable = Variable * Factor 

and 

Variable = Variable / Factor 

become (Variable *= Factor) and (Vari- 




WHEN <value 1 is ture> => Outcome # 1 
WHEN Oalue 2 is ture> => Outcome # 2 

OTHERWISE => Outcome # X 

SND CASE 



Listing 3. 



14 COMPUTER LANGUAGE ■ FEBRUARY 19B5 



able/ = Factor), respectively. 
■ Remarks. For those who want to for- 
malize remarks and comments, borrowing 
from Ada's syntax is useful. The remark 
is expressed by at least two consecutive 
dashes, as in; 

— This is a remark 

This one too! 

and so is this — 



Listing 4 shows pseudocode for solving 
a single nonlinear equation using the 
Newton-Raphson method. The PPL 
shown reflects a rather detailed code 
revealing very specific algorithms. 

Listing 5 shows the code for a 
regression program that will read data 
from a file and perform a best-fit 
regression. This is done by subjecting the 
data read to a combination of mathe- 
matical transformations. Each of the latter 
represents a different regression model. 

The code shown will process the data 
through four models. The slope, intercept 
and correlation coefficient is calculated 
for each model. An insertion sort is per- 
formed as results are obtained for each 
model. This allows for the printing of the 
curve fitting information sorted from best 
to worst model. The PPL listing reflects 
the case where a programmer is avoiding 
detailed coding in certain areas. 



D 



l o you have any 
I comments or 
suggestions 
concerning PPL? Does the idea of a con- 
sistent type of pseudocode appeal to you? 
Is it too restrictive? Would you like to par- 
ticipate in a SIG-PPL group for further 
refinement of PPL? Let me hear from 
you. Please write to me in care of 
COMPUTER LANGUAGE, 131 Townsend 
St., San Francisco, Calif. 94107 or con- 
tact me through the BBS or CompuServe. 

In the next issue I will discuss inter- 
active parsers and interpreters for mathe- 
matical equations (i.e., the heart of elec- 
tronic spreadsheets). If you have any code 
or algorithms to share, questions to ask, 
or would like to enrole in the SIG list, 
drop me a line. Remember that the SIGs 
are there to help exchange information 
and, who knows, perhaps find your next 
software coauthor! H 



PPL listing for solving a single nonlinear equation 
using the Newton-Raphson method 

PROGRAM Root 

Version 1.0 June 10, 1984 

LAST UPDATE : 06-15-84 12:22:23 

INPUT Guess, Accuracy, Maximum 

INITIALIZE Set Counter = 
Set Goflag True 
LOOP 

— The token below is not followed by anything as part of 

— simulating the REPEAT-UNTIL loop 
BEGIN 

IF abs(Guess) > 1 THEN Increment = 0.01 * Guess 

ELSE Increment = 0.01 

END IF 

Delta_X = 2 * Increment * {F(Guess)} / 

({F(Guess + Increment)} - {F(Guess + Increment)] 

Guess -= Delta_X 

Counter += 1 

IF Counter > Maximum THEN Goflag is False END IF 



When (abs(Delta_X) <= Accuracy) OR (Goflag is False) 'EXIT 

END LOOP 
TERMINATE None 
IF Goflag is True THEN 

DISPLAY Guess and Counter 
ELSE 

DISPLAY Message for divergence 
END IF 

END PROGRAM — This is optional 



FUNCTION (F(X)} 
— User function 

F = EXP(X) - 3 * X * X 

END 

END PPL 

Listing 4, 




X X K H 



15 



PRENTICE-HALL: 



THE C/URIIX* 



C TITLES 

1. Programming in C with a Bit 
of UNIX*, F. Richard Moore. A first 
glimpse of C for the computer novice. 
1985. 388 pp., paper [73009-3} S 16.95; 
cloth |730IO-1) S22.95. 

2. Learning to Program In C, Thomas 
Plum. Plum walks programmers through 
the world of C. 1984, paper (52784-6) 

S 2500; cloth (52785-3) S32.95. 

3. C Programming Guidelines, 
Thomas Plum, Put yourself on solid 
ground with this clear explanation of 
the standards. 1984. 145 pp.. paper 
(10999-1) $26.00. 

4. The C Programmer's Handbook. 
AT&T Bell Laboratories. M. I. Bolsky. 
Destined to be the C programmer's 
constant companion. 1985. 96 pp.. 
spiral (11007-2| S 14.95. 

5. The C Programming Language 
Brian W. Kernighan and Dennis M. 
Ritchie. The "Bible'— a must for C pro- 
grammers. 1978, 228 pp., cloth 
(IIOI6-3| S22.95. 

6. C: A Reference Manual, Samuel 
P. Harbison and Guy L. Steele. The 
latest details of C— right at your fmger- 
tipsl 1984, paper (11000-7) $19.95; cloth 
(11001-5) $24.95. 

7. The C Puzzle Book. Alan R. 
Feuer. Challenge your mind with these 
C brain teasers. 1982. paper (10992-6) 
$14.95; cloth (10993-4| S 18.95. 

8. Comparing and Assessing 
Programming Languages— Ada, 
C. and Pascal. Alan R. Feuer and 
Narain Gehani. Which language suits 
you best7 Feuer and Gehani spell it outl 

1984, 256 pp.. paper (15484-9) $16.95; 
Cloth (15485-6) S24.95. 

UNIX TITLES 

1. The UNIX* Programming 
Environment. Puts two UNIX experts 
right at your side. 1984. paper (93768-0) 
SI9.95: cloth (93769-6) $26,95. 

Brian Kernighan and Rob Pike 

2. A UNIX* Primer, Ann Nicols Lo- 
muto and Nico Lomuto. Lays out UNIX 
by cutting through common -problems. 

1983. 240 pp., paper (93773-0) $20.00; 
cloth (93888-6) 5 21.95. 

3. UNIX* for People. Peter Birns. 
Patrick B. Brown, John C. Muster. Learn 
the UNIX language in your language! 

1984. 544 pp.. paper (93744-1) S 19.95: 
cloth |93745-8| 29.95. 

ORDER YOUR FREE 15-DAY 

TRIAL COPIES TODAY! 

By phone: dial (201) 767-9520 or 

write to Steven T Landis, Prentice-Hall 

Book Distribution Center. Route 59 at 

Brook Hill Drive. West IMyack. New York 

10995 OR . . .VISIT YOUR LOCAL 

BOOKSTORE 

"UNIX is a trademark of AT&T Bell Uborarones 



PPL listing for best-curve fit 

PROGRAM BEST_FIT 

Version 1.0 June 10, 1984 

LAST UPDATE : 06-15-84 12:22:23 

INPUT Filename — Get name of data source 

OPEN Filename, #i, INPUT 

READ #l,Number_of_data — Read the amount of data 

INITIALIZE None — Loop to read the (X,Y) data pairs 

LOOP 

BEGIN For counter = 1 to Num_of_data 
READ #l,X(counter),Y(counter) 

END LOOP 

TERMINATE CLOSE #1 — close buffer 

Set Numjfodel = 4 — This sets number of models 
[DO REGRESSION] 
Print .sorted results 
END PROGRAM 



PROCEDURE [DO REGRESSION] 

INITIALIZE None 

LOOP Outer 

BEGIN For model = 1 to Num_Model 

INITIALIZE Set regression summation to zero 
LOOP Summmations 

BEGIN For count = 1 to Num_of_data 
[Transform] 

Update summations using X and Y 
END LOOP Summations 
TERMINATE None 
Calculate Slope, Intercept and correlation coefficient 

— Perform insertion sort using the values of the 

— correlation coefficient 
[SORT] 

END LOOP Outer 
TERMINATE None 

END 



PROCEDURE [Transform] 



CASE model 
WHEN 1 



WHEN 
WHEN 
WHEN 

END CASE 

END 

END PPL -- 



=> X = X(count); Y = Y(count) 

=> X = Log(X(count)); Y = Y(count) 

=> X = X(count); Y = Log(Y(count)) 

=> X = Log(X(count)); Y - Log(Y(count)) 



This must be included in every PPL listing using 
program NILE. PAS 



Listing 5. 



CIRCLE 83 ON READER SERVICE CARD 

16 COMPUTER tANGUAGEB FEBRUARY 1985 



DESIGNERS DEBATE 



UNIX on micros 




NIX has been 

around on mini- 
computers for a 
long time. This month, however, let's 
focus on the future of UNIX as a micro- 
computer operating system alternative. 

Many factions in the microcomputer 
industry have stated that UNIX may never 
receive the market acceptance UNIX sup- 
porters claim it will primarily because of 
certain inherent problems with the UNIX 
operating system's overall organization 
and interface to the programmer and 
end user. 

Let's turn now to a discussion of UNIX 
on micros and focus on certain arguments 
that deal with UNIX as a development 
environment. 

The following people debate the UNIX 
issue in this month's column: John 
McNamee, a free-lance consultant: Jack 
Crenshaw, software engineer; Bob Peter- 
son of the MUSUS SIG on the Compu- 
Serve data base; Mike Cohen: Morton 
Goldberg; Tim Smith; Bob Upshaw; 
Earle Robinson; Eli Willner; Joel Swank; 
and Dennis Hamilton. 

s it reasonable to 
run UNIX on a 
micro? It has a 
reputation as a rather large operating sys- 
tem, requiring vast amounts of memory 
and disk space. 

McNamee: Define micro and you 
will get a better answer. I doubt a 
Commodore 64 will run it. and the IBM 
PC has a hard time. My view is that UNIX 
requires a CPU made by somebody other 
than Intel and a disk drive that is faster 
than the ST506 interface. 100-millisec 
seek drives you find in PCs. 

Peterson: I have had occasion to 
look into how much machine UNIX 
needs. I came to the conclusion that 256K 
RAM. memory management/protection 
and 5MB of hard disk space are the abso- 
lute minimums for UNIX. 

Certain clone systems— for example. 




By Ken Takara 

IDRIS— require less disk space and no 
memory management. This places UNIX 
in the medium to upper ranges of micros 
at a usual cost of S5 ,000 th rough $7 ,000 
for the basic machine. This would be for a 
single-user machine. 

I tend to believe that UNIX is a better 
fit with the architecture of the MC68000 
and National 32000 processors. In the 
Intel world, an 80286 is probably the real- 
istic minimum for decent performance. 

Cohen: 256K RAM? Try doing any- 
thing useful on a 256K TRS- 16! 5 1 2K is 
more like it. That and a 5MB hard disk 
would still be a very tight fit. A nice thing 
would be a streamlined, single-user 
UNIX subset. 

McNamee: That's not really true. 
The PDP-1 1 is a mini, and it can only 
address 64K of code plus 64K of data, and 
you can't even play tricks to get more. 
There are no user-accessible segment reg- 
isters. The definitions of super-micro, 
mini, super-mini, and mainframe seem to 
constantly change. When the PDP-1 1/70 
came out, everybody said it was almost a 
mainframe. Now you can get an 
LSI-1 1/73 with about the same speed right 
on your desk. 

I think Fortune tried to sell floppy- 
based UNIX. You will notice that their 
profits (or should I say, lack of them) may 
have had something to do with trying to 
sell systems too small to run UNIX. 
Tandy threatened to release floppy-based 
XENIX, but so far it has not shown up. I 
don't know anybody else doing it, 

Goldberg: I'll stick my two cents in. 
I had VENIX/86 running on my PC-XT I 
killed it because it wanted too much disk 
space. It would only allow PC-DOS 3MB 
of the 10MB on the hard disk. My 
PC-DOS applications outgrew 3MB and 
VENIX had logo. 

VENIX/86 is a real UNIX, an AT&T 
licensed version 7 with some Berkeley 
enhancements such as the vi screen editor. 
Code developed under VENIX should run 
on most UNIX systems if it is recompiled 
on the system it is moved to. I got VENIX 
to develop code for what I thought was 
going to be the booming UNIX-on-PCs 
market. But the market didn't boom. 

I earn more money from stuff I do on 
PC-DOS than I could with the VENIX 
stuff. So it was an economic decision that 
forced me to abandon VENIX. If I could 



have afforded a second hard disk, I would 
have kept them both. 

Crenshaw: It seems to me every- 
one's missing a key point: UNIX is a time- 
sharing system. That means that one CPU 
is used to poll or otherwise respond to a 
usually large number of user terminals. It 
also means a very considerable overhead 
is required to allow that CPU to do all the 
bookkeeping necessary to support that. 

Thai means context switching, access 
control, virtual memory overhead, prior- 
ity control, accounting, mail and message 
handling— not to mention the ubiquitous 
news! — etc., etc. That doesn't leave much 
CPU left over for number crunching, as 
anyone who's ever used a 40-user VAX 
can testify. 

UNIX is without a doubt the best OS 
ever written for multi-user, time-sharing 
systems, bar none. Now the question is. 
do such systems have any place on a 
micro? As a strong supporter of Purnelle's 
law— at least one CPU per user— 1 claim 
they do not. For some reason, whenever a 
new computer is announced (for example, 
the IBM PC AT) the first question asked 
is, will it run UNIX? The next one is. how 
many users will it support? 

My question is. why do we want lo 
crowd people onto a single CPU? Has sil- 
icon suddenly become a precious metal? 
To get back to sinale-user UNIX, isn't 
that" OS -9? 

McNamee: There is no reason why 
UNIX can't be run single user. The only 
difference between multi-user and single- 
user UNIX is an entry in /etc/iTys. A pro- 
cess is a process is a process. It doesn't 
matter if they are all attached to the same 
terminal or to multiple terminals. 

1 think the reason everybody asks if it 
runs UNIX and how many users it sup- 
ports is that networks aren't doing the job 
they should. Right now it costs less to 
have one machine serving multiple users 
than it docs lo network a bunch of PC's. 

Peterson: UNIX Is one of the few 
operating systems that will live com- 
fortably on a local area network. A single- 
user UNIX machine in a LAN satisfies the 
morc-than-onc processor/user criterion 
while providing multitasking. OS-9 is not 
UNIX, nor is it a single-user UNIX. 



17 



There is a need in [he real world to 
share data. At the current time, a multi- 
user machine is the best understood envi- 
ronment for data sharing. The LAN envi- 
ronment is finally getting some software 
packages that share across the network, 
but they are few. 

At the present time, a 3 to 10-user 
machine is cheaper than 3 to 10 micros. 
This is because of the mechanical devices 
and packaging, not the silicon . When the 
economics of the world change so that a 
LAN environment with data sharing tools 
is less expensive than a multi-user 
machine, and such a system is available 
from a trusted vender, then LAN systems 
will become more prevalent than multi- 
user systems. 

Hamilton: I believe that UNIX hav- 
ing been implemented in a time-sharing 
setting is irrelevant to a discussion of what 
UNIX is. There isn't much about the 
architecture that users see that commits 
UNIX one way or the other. 

You build it with a time-sharing kernel 
when you've got a large facility that you 
want to share. When you have small facil- 
ities that you want to interconnect, you do 
it differently. But the user, apart from 




observed performance differences, should 
be able to get work done on either with the 
same knowledge and skills. 

ow, who would 
want to use the 
world's most 

impossible system . . . ? 

McNamee: A programmer with an 
IQ greater than his or her shoe size should 
have no problem. Users are best given 
menu shells or another such interface. 
Turning a dumb user over to one of the 
standard shells is cruel and unusual 
punishment. 

UNIX was a system designed by pro- 
grammers for other programmers. It does 
make it very easy to set a user up with a 
menu shell, but you need a programmer to 
do the initial setup. I think the same could 
be said about CP/M or MS-DOS. The 
CP/M prompt A> doesn't give you much 
more to go on than + or % . 

Peterson; UNIX is an old system. 
Many times this means that there is a lot 
of software available, and for UNIX this 
is true. But in the UNIX world, this soft- 
ware isn't oriented to the business or per- 
sonal user but to the academic or software 
developer. 

The fact that UNIX was designed in the 
early 1970s also means that it was based 
on contemporary design principles and 
hardware. This implies that UNIX itself 
doesn't know about bit-map displays, for 
example. Some applications do. and some 



venders do ship bil-map-oriented user 
interfaces, but these are add-ons. not a 
part of the basic system. 

The average user will be better served 
with TopView on an IBM PC AT or with 
some other system for which appropriate 
applications software is available. 

U pshaw: The only way to address 
the severe shortage of good software is to 
make it possible to write a piece of soft- 
ware once and use it on a large number of 
different machines. 

It's clear to even the most casual 
observer that UNIX is running on more 
different machines than any other oper- 
ating system. It's only natural that UNIX 
migrate to micros. 

Crenshaw: I think when many peo- 
ple talk about UNIX, they are really talk- 
ing about the user interface. And that can 
begotten in a lot of OS's. As a matter of 
fact, I think wc should be sure we are all 
talking about the same aspects of the OS. 

The part of UNIX that 1 think is least 
suited to micros is the file system and the 
terminal interface software. I love the 
directory structure and the shell. 

McNamee: 1 am a programmer. I 



Hard problems? 



Csharp can help! 




Cut your development time with C source code for realtime data acquisition and 
control. The Csharp Realtime Toolkit includes: graphics, event handling, 
scheduling, and state systems. Processor, device, and operating system 
independent. 




SYSTEMS 
GUILD 



Systems Guild, Inc., P.O. Box 1085, Cambridge, MA 02142 
(617) 451-8479 

CIRCLE 89 ON READER SERVICE CARD 



18 COMPUTER LANGUAGE! FEBRUARY 1985 



know what I'm doing. I usually get things 
right. UNIX is for people just like me. It 
provides me with the tools to get my job 
done in the least amount of lime with the 
least effort. It also allows me to easily cre- 
ate any user interface I desire. 

I can set up a machine that secretaries 
can use without ever knowing about any 
UNIX commands. AM they need to do is 
log in. The only people who lose with 
UNIX are the ones who need help (i.e., 
dumb end users) but don't buy a system 
with proper support fin the form of a pro- 
grammer to set them up). 

It is very important to remember that 
UNIX is not MS-DOS or CP/M. It is a 
multi-user operating system. I don't know 
of any good multi-user system that is so 
simple a total novice could make it go 
without help. Sure, it's easier to use 
MS-DOS, but MS-DOS does not solve the 
same problems as UNIX. 

Smith: I like UNIX too, as a pro- 
grammer's system. But I curse it many 
times, for example, when I forget some 
bizarre aspect of. say, shell syntax. Also, 
as a one-time UNIX system administrator 
on a big VAX, I know how bad it can be 
when you have a bunch of dumb and/or 
unfriendly users aboard. 

We need something better. There's no 
reason why it can't be done. Maybe it's 
mice and icons for the end users and a 
good shell for the experts, both on the 
same system. But it's going to have to be a 
lot more efficient than any current UNIX. 

Robinson: I can certainly agree that 
UNIX is better than CP/M, which is only 
a very primitive file loader. Bui to say that 
it is better than MS-DOS for a single user 
is something else. UNIX, due to its con- 
stant file accessing, would be unaccept- 
ably slow on most micros unless it were a 
CPU of the MC68000 family. 

Otherwise, with the features now avail- 
able under MS-DOS and the excellent 
public domain utilities— like directory 
programs, extended type-ahead buffer, 
NDOSEDIT, editors, squeeze and 
unsqueeze programs, shells, 
etc. — MS-DOS is the system of prefer- 
ence for most people other than those 
actually doing program development . 

McNamee: Does dir really mean 
more that As? I doubt it. Most of the places 
where I've seen a large number of dumb 
users doing computer work, they all had 
their instructions written down, and they 
just followed the steps. They really didn't 
know what they were doing, and in this 
kind of environment, it doesn't matter 
whether you type delete , era , or rm to 
erase a file. 

Crenshaw: Count me in as one who 



has been less than overwhelmed by 
UNIX. Well, to be more accurate, the 
thing that turns mc off most is not so much 
the system as the aura of mystery that 
seems to surround it. It's what I call the 
Fraternity Syndrome. 

In brief, a young computer science stu- 
dent gets his first exposure to UNIX in 
school. He's totally blown away by it and 
totally in awe of the UNIX wizards. But 
after stumbling around for a few years, he 
learns some things and wakes up one 
morning to find that he's one of the wiz- 
ards. He's held in awe by others and that 
feels pretty good. 

Now do you think he's going to tell you 
all you need to know to use UNIX effec- 
tively? No way. You're going to have to 
pay your dues, same as he did. 

I find that this attitude pervades every- 
thing about a typical UNIX installation, 
including the command names and the 
documentation. Tome, it takes a lot of the 
fun out of things. It's like some kind of 
gigantic inside joke. 

Willner: One more vote against 
UNIX. I don't like to fight my environ- 
ment. I don't like to memorize archaic 
commands, no matter how much it makes 
me look like a wiz. I don't like to destroy 
all my files because of a misplaced 
keystroke. 

Swonk: UNIX is hard to learn, but 
once learned, it is very powerful. I can do 
in one line in UNIX what would take me 
200 cards in IBM-360JCL. 

Pet erson: Willner pointed out a cou- 
ple of the reasons I don't like UNIX. The 
command names don't relate to the func- 
tion of the command and I. too, don't like 
an environment where dangerous oper- 
ations don't prompt for verification. 

However, my dislike goes deeper. 
UNIX doesn't have a consistent method of 
record locking, and the file system is 
excessively fragile. The OS doesn't take 
advantage of the fact that almost all termi- 
nals are now CRTs, not TTYs. Not to 
mention that UNIX doesn't understand 
bit-mapped displays. 

One of the great myths about UNIX is 
that there is a single thing named UNIX. 
This just isn't so. User groups are just 
now defining what they consider the core 
of UNIX, including OS calls and library 
utilities. In addition to the various ver- 
sions delivered by AT&T and Berkeley, 
each processor's and/or vender's imple- 
mentation differs in subtle ways. 

I like the tools philosophy embodied in 
UNIX and the concept of pipes. However, 
the idea of pipes deserves to be extended. 
It hasn't really changed since UNIX was 
first written up in SIGPLAN notices. 

Upshaw: The UNIX user interface 
allows one to easily go from one machine 
to another. Sure VisiCalc will port fairly 
easily from one CP/M machine to another 
(say, an Apple to a Xerox 820), but it's a 
rewrite to port to an IBM PC, not to men- 



tion a VAX or a Cray (yes. there is a 
spreadsheet on the Cray). And. of course, 
the UN1X/C environment is conducive to 
portability. 

McNamee: I like UNIX as a pro- 
grammer's environment and would hate to 
see it turned into a pure end-user system. I 
think it is quite possible to build a reason- 
able interface on top of existing UNIX. I 
don't think you can build a programmer 
friendly interface on top of a Mice/Icon 
system. 

In its intended environment, the Mice/ 
Icon interface works well. It just doesn't 
do anything good for me as a program- 
mer, and in fact, it holds me back. I want 
to bring up again my point that it isn't fair 
to compare the user friendly aspects of 
UNIX to existing single-user OS's. 

Compare it to other time-sharing sys- 
tems. Multi-user systems such as UNIX 
were created with goals very different 
from those of the Mac. UNIX is good for 
what it was designed, and the Mac is good 
for what it was designed. UNIX is not the 
OS for everybody or even for the majority 
of the people. 

Upshaw: When I am interviewing 
candidates for a job, more often than not 
they have used UNIX. UNIX is very pop- 
ular in the universities, and with all the 
major venders jumping on the UNIX 
bandwagon, its popularity is likely to 
increase. 

When I hire someone, I don't want to 
train my employee to use five different 
systems— I've got more important things 
to do. If he or she already knows the sys- 
tem that runs all five of my machines. I'll 
save a considerable amount of time and 
money. ■ 

Smith: Try to get hold of a copy of 
the November issue of UNIX Review . 
There's an interview with Don Norman, a 
professor of psychology at Univ. of Cali- 
fornia at San Diego. In it he explains why 
he does and doesn't like UNIX. He's a 
sharp guy and has become something of 
an expert in the design of systems for 
good human interaction. 

eriodically, I will 
be holding argu- 
ment clinics over 
some subject on the CLM SIG on Compu- 
Serve. If you don't happen to have a 
CompuServe account, you can si ill join 
in. I will try to announce the future sub- 
jects in advance on the COMPUTER 
LANGUAGE Bulletin Board Service, so 
send your thoughts through the mail or via 
the BBS. II 




19 



THE MAGAZINE 
FOR THE FULL-OUT 

BRAINO. 



Computer Language is written for 
people who can program in Two 
or more computer languages. 

Let's face it, that leaves out most 
people. Programming is a rigor- 
ous, intellectual discipline and 
Computer Language magazine 
is the first and only publication 
dedicated exclusively to this field. 
Your source for the latest 
technical skills and methods 
used by software specialists. 

We cover the major develop- 
ments in the software design field, 
from theory to implementation. 
Computer Language focuses 
on the most important and 
useful language design /\ 
information available in 
the fast-moving micro- i 
computer industry. 
Written for the 
person who takes 
computing 
seriously. 

We're talking 
about you — the 
experienced 
software author, 
programmer, or 
engineer who 
routinely programs 
in two or more 
high-level 
languages. 

A person who understands the 
creative nature of programming 
and appreciates the beauty of 
efficient code in action. 
COMPUTER LANGUAGE will 
constantly challenge your 
abilities. 

The foremost industry experts will 
discuss: • Algorithmic Approaches 
to Problem Solving ■ Language 
Portability Features • Compiler 
Designs ■ Utilities ■ Artificial 

20 COMPUTER LANGUAGE ■ FEBRUARY1985 





COMPUTER » 

LANGUAGE- 







V. , 



Intelligence ■ Editors ■ New 
Language Syntax ■ Telecommuni- 
cations • Language Selection 
Criteria ■ Marketing Your Own 
Software • Critical Software & 
Hardware Reviews 

Send lo; 
COMPUTER 

LANGUAGE 

2443 Fillmore Street Suite '346 San Francisco, CA 941 1 5 1 



YES! Start my charter subscription to 

Computer Language. My I year charter 
subscription is just $24.95, a 33% 
savings under the single copy price, 

a $24.95 D Bill me. 

Paymenl Enclosed 



Name 



Address 



City 



State 



Zip 



C 



COMPUTERVISIONS 



PJ. Plauger reflects on the history of C 




c calls himself a 
programmer al 
heart. But as an 
accomplished science fiction writer, pres- 
ident of a successful software company, 
technical book author, musician, and run- 
ner, P.J, Plauger is certainly a man of 
many talents. 

His friends and work associates know 
him as Bill — a name he was affectionately 
given by his older sister three days after 
his birth. But in any published, profes- 
sional work, he prefers to use the initials 
of his real name, Phillip James. 

Plauger "s first contact with Bell Labo- 
ratories was as a undergraduate at Prince- 
ton Univ. in the early 1960s. He and 
several of his fellow students were fortu- 
nate enough to shuttle back and forth 
between Bell Labs and school and get 
involved in temporary summer projects. 

"In those days it was heaven," says 
Plauger, "It was the place to go because 
just about anything you could do that 
would advance the state of communica- 
tions in the next five years was considered 
fair game. And it was the place to be if 
you were interested in being at the cutting 
edge of programming." 

"In the 1960s, there was still this tre- 
mendous intellectual freedom in the very 
undefined world of computer program- 
ming," he remembers. "Maybe a place 
like IBM Yorktown Heights. RCA, GTE, 
or XEROX would come close, but Bell 
Labs was really just a wonderful place to 
be for freedom and access to resources." 

Plauger went on after Princeton to earn 
a Ph.D. in nuclear physics from Michigan 
State Univ. There he spent half his time, 
with a fellow graduate student, designing 
and writing a virtual memory operating 
system. He confesses that he "invented" 
demand paging, not knowing that the rest 
of the world had already done so. 

"I've worked and earned my living as a 
programmer since 1963. and I say that 
very proudly." says Plauger. "I consider 
myself a programmer rather than a man- 
ager or a computer scientist. Those arc 
things that I've done, but I've earned my 
living as a computer programmer." 

Plauger started working for Bell Labs 
upon receiving his doctorate in 1969, first 



By Craig LaGrow 

at Holmdcl. N.J., then later at their Mur- 
ray Hill, N.J., headquarters. He spent his 
five and one-half years at Bell Labs as a 
member of technical staff, which is the 
standard staff level for people doing 
research. His department was chartered 
with getting computers into telephone 
central offices and digitizing things so 
that data processing technology could be 
better brought to bear. 

But he was also surrounded by people 
like Dennis Ritchie, Ken Thompson, and 
Brian Kernighan, who were working on 
the beginnings of what was to become 
UNIX and C. He naturally soaked up as 
much of that technology as he could, fas- 
cinated by anything that could improve 
programmer productivity. 

While Plauger was working at Bell 
Labs, he designed small, in-house lan- 
guages, built a few compilers, and began 
to work with rudimentary UNIX and pro- 
gram development tools. 

"In many ways, the success of UNIX 
was little more than a matter of Thompson 
and Ritchie setting up fences, if you will, 
to herd people in the right direction," 
remembers Plauger. "They just made it 
easier for people to write reusable soft- 
ware with good properties. If there has 
ever been a central committee on how to 
homogenize UNIX, it has only existed the 
last couple of years — and a lot of the pay- 
off has been lost in the growth and size of 
UNIX from attempting to homogenize it." 

According to Plauger, there is no ques- 
tion that Ritchie invented the C language 
and made it what it is today. 

"It was his baby, and that's one of its 
great strengths; its integrity stems from 
the fact that there was one good designer 
who was really responsible," says Plau- 
ger. "All of us to this day who are 
involved with it deferred to him." 

klauger was one of 
'the first real C 
programmers. 
Working on an old PDP-1 1/20— the verv 
first PDP-1 1 UNIX system— he recalls' 
tripping over many of the bugs when 
things like structures first went into the 
language. 

An interesting footnote to the C lan- 
guage development going on at the time 
was that Plauger was simultaneously 
developing a language he hoped would 





rival C. He then completed a language 
implementation that today would resem- 
ble something like PL/M for the PDF- 1 1 . 

"One of the smarter things 1 did in my 
career was realize after a period of lime 
that the C language was superior to 
mine," he says. "I actually had the 
decency to stand up and tell a lot of people 
that even though I'd put a lot of work into 
this language. C was better and they 
should use it instead. I became a convert 
in the early days." 

Thompson had been experimenting 
with a language called B. a precursor to C 
that was, according (o Plauger, a "cute 
derivative" of another experimental lan- 
guage called BCPL. "The trouble with it 
on a PDP-1 I, though, was that it assumed 
everything was a 16-bit integer," Plauger 
recalls. 

The B language could manipulate point- 
ers like 16-bit integers but, because of its 
weakness with byte resolution addressing 
of the PDP-1 I . a programmer had to 
know to count by twos to step through an 
array. Because of this, data typing went 
into the language just to help the compiler 
know how to manipulate pointers to dif- 
ferent types of data. 

The second problem with B was that it 
wasn't a true compiler but rather an 
interpreter. 

"C in a nutshell is B with typing to get 



21 




SOFTWARE 
DEVELOPERS! 

V-FILE 

THE VIRTUAL MEMORY 

FILE MANAGER 

Let V-FILE save precious development 
time & cost as you create efficient appli- 
cations with the power of VIRTUAL MEMORY. 

DON'T RE-INVENT THE WHEEL 

Why spend weeks or months coding and 
debugging file and memoiy management 
systems when you can order V-FILE today. 
V-FILE is a library that you can link with 
your code to provide sophisticated virtual 
file and memory management — allowing 
you to concentrate on developing your 
application. 

VIRTUAL DATA 
OBJECTS SUPPORTED! 

Data is referenced by using VIRTUAL 
MEMORY DATA HANDLES. Your code 
doesn't need to know whether the data 
is actually on disk or in RAM. Swapping 
between disk and RAM and updating files 
on disk is handled automatically and trans- 
parently! Complex VIRTUAL DATA 
STRUCTURES can be created by linking 
with data handles instead of pointers. 

CHECK THESE FEATURES! 

• Multiple, independent swap buffers 

• Multiple files per swap buffer 

• Highly efficient swap algorithm 

• Automatic file updating 

• Data prefetching supported 

• Data may be locked in memoiy 

• Memory buffers may be flushed 

• Makes full use of extended memory on 
IBM PC/AT 

• SOURCE CODE AVAILABLE 

• NO ROYALTIES REQUIRED 

Supports Dos 2.00+ with 

Lattice & Microsoft C compilers 

Supports Microsoft windows 

S299 

^ Contact: 
i pit p MindBank. Inc 
* J^ 1 — 4620 Henry Street 

Rttsburgh. PA 15213 
^ TM 412/683-9800 

VISA/MASTER CARD ACCEPTED 

CIRCLE 63 ON READER SERVICE CARD 
22 COMPUTER LANGUAGE! FEBRUARY 1985 



^ 



the pointer arithmetic right and true com- 
pilation to get better efficiency," says 
Plauger. 

Ironically, however, all the develop- 
ment work on UNIX and C at the time was 
being done in total opposition to the 
administrative philosophy of Bell Labs. 
The fact that the project survived, accord- 
ing to Plauger, was mostly due to a policy 
of "salutary neglect" on the part of 
management. 

"'There were no projects, no specs, no 
requirements: it was almost all done on 
speculation — all of it," says Plauger. 
"Over about a two-and-onc-half-year 
period, one by one most of the people in 
our area at Bell Labs elected to do their 
work on UNIX, but nobody told them to," 
he says. 

The GE 635 computer, which was one 
of the large systems that Bell researchers 
were supposed to be using in their work, 
actually turned into a remote printer for 
the UNIX machine as far as this group 
was concerned. 

"Nobody made them do that. Nobody 
made them write up the utilities which 
eventually got swept up into the UNIX 
package. Nobody enforced a uniform 
style," says Plauger. "As a consequence, 
we can all now piss and moan about the 
irregularities that are there. But consid- 
ering there was no enforcement, it's 
remarkably regular. The miracle is that 
UNIX is as good as it is. not that it 
couldn't be better." 

The early prototypes to UNIX and C 
also were being used For many interesting 
projects in-house at the time. Plauger 
often reminds people that Thompson 
started UNIX to support his own "little 
solar system exploration thing" so it 
would be easier to develop the software 
for it. 

"There were half a dozen people hang- 
ing around the UNIX room because each 
had his own little pet project going, and 
UNIX was the best leverage to get that 
accomplished," says Plauger. "Not a sin- 
gle one of them was chartered by manage- 
ment in order to improve productivity or 
in order to pursue that particular goal." 

"It was very easy to get caught up in all 
this," he recalls. "Of course having Brian 
Kernighan next door to shoot the bull with 
and speculate about what we could do 
with all these things was great." 



l*^c 



s Kernighan and 
Plauger became 
Lcloser friends 
and work associates, they ended up writ- 
ing two books on programming style 
called The Elements of Programming 
Style, ' Software Tools , 2 and Software 
Tools in Pascal, 3 which have become text 
book standards in many computer science 
curricula across the country. 

"I think Brian had a folder of examples 
that showed how bad the training for pro- 



grammers was at the lime," he says. 
"Finally, we'd get to a 'there ought to be a 
law' stage." 

"What we did with Tlie Elements of 
Programming Style was to write the manu- 
script fairly quickly and circulate it 
among our friends." he recalls, "We'd 
tend to go on a kind of feeding frenzy, 
tearing up programming examples from 
other books, II took us a couple of iter- 
ations to get to the correct style that I 
think made the book what it is. 

"Brian is a very solid writer, very 
direct. And I've tried to emulate Issac 
Asimov's science-fact writing," says 
Plauger. "Between the two of us, Brian 
and 1 managed to keep the worst offenses 
of our programmer arrogance and love for 
big words out of the document. It man- 
aged to be something better than either 
one of us could have done on our own." 

Plauger remembers Ritchie being a bit 
more distant to him both professionally 
and socially at first. "He lived in his own 
world, which was populated by the likes 
of Ken Thompson and Doug Mcllroy," 
says Plauger. 

"It was like, wow, this guy comes in at 
1 :30or2:00 p.m. and immediately goes 
to lunch! But nobody seemed to mind 
because he'd work till midnight with these 
people, and they'd all get tremendous 
amounts of brilliant work done." he says. 

Plauger admits that he'll always have a 
tremendous respect and admiration for 
Ritchie. "He's a marvelous writer and an 
excellent designer with what amounts to a 
slightly enhanced version of Appendix A 
in Ritchie's and Kernighan's famous 
book, Tlie C Programming Language . 
Also of importance was the /usr/group 
effort on standardizing libraries. 

Serving as the secretary of the commit- 
tee since its inception over a year ago, 
Plauger was also appointed chairman of 
the Library TG— one of the three tech- 
nical subcommittees working on pieces of 
the soon-to-be published ANSI X3J 1 1 C 
standard. 

"I think it's amusing that I ended up as 
chairman of the Library TG because some 
have said that's like putting the fox in 
charge of the hen house,' ' jokes Plauger. 
"I gravitated toward that because of the 
tremendous technology that my own com- 
piler company [Whitesmiths Ltd.) has 
developed for making C work well— not 
just in UNIX but everywhere." 

"We all agreed to adopt the /usr/group 
standard as the base document for the 
library standards effort. Essentially what 
I did was show the committee how to 
modify that set of functions to get the 
UNIX-isms out, so that they could be 
implemented in a variety of 
environments. 

"We also have put forward and adopted 
a number of additional functions which 



you need outside of the UNIX environ- 
ment. The net result is that what ANSI 
now has is functionally very compatible 
with UNIX V7 and System III, which 
/usr/group has standardized on, but is 
strongly enhanced semantically to make a 
more widely usable standard," says 
Ptauger. 

Participating in the ANSI committee 
meetings have been representatives from 
over two dozen C compiler companies. 
Consequently, the interests of many com- 
panies comes to bear in each of the stan- 
dards meetings. 

According to Plauger, compiler manu- 
facturing companies have a strong influ- 
ence on the outcome of the standard- 
ization. "Other groups, such as educators 
and independent consumers, are often 
outvoted because of this makeup," he 
claims. 

"Obviously one of the reasons that 
we're having all these standardization 
meetings is that we have these different 
dialects that have evolved in different lit- 
tle communities. What we're trying to do 
is to bring them together." 

Plauger feels strongly that the main 
purpose of the ANSI standards effort is to 
create a marketplace for the C language to 
grow into. 

"If there is no marketplace, there's no 
way you can make money," says Plauger. 
"You can bury your gold in your back 
yard and be safe, but that's not a market. 
Or at the other extreme, if there are no 
rules for safe trade, there'll always be 
pirates waiting out there every time you 
send a ship out to do business. It'll get 
boarded and everything gets ripped off. 
That's not a marketplace either." 

But today, after a year and one-half of 
meetings, the committee is preparing to 
finalize a document that will formalize the 
rules and definitions that future C com- 
piler writers will follow when designing 
different implementations of C for differ- 
ent hardware and operating system 
environments. 

"In these last few meetings, we're 
really just getting down to the sorts of 
things that Talmudic scholars would sit 
around arguing about on a Saturday," says 
Plauger. "We're really just quibbling over 
whether certain nice extensions should get 
stuck into the language before it's frozen 
and what the subtle interpretation is of 
certain types of coercions. Things like 
that." 

r et Plauger is also 
willing to admit 
that he thinks the 
C language will soon begin to decline in 
popularity within the programming com- 
munity as a whole. 

"My feeling is that C is just short of 
peaking in popularity— that is, it has 
almost peaked and will start declining 
soon," says Plauger. "C has some mainte- 




nance problems with large programs. It's 
a little too lax in its declarations and its 
type checking, and it doesn't have all the 
facilities you need, such as for 
packaging." 

"You see the amount of stuff that's been 
wriiten in C, from commercial applica- 
tions to you name it," says Plauger. 
"FORTRAN ranks in popularity right up 
there with C, but C is unquestionably the 
better language right now. Its major lim- 
itation is that when you get a program- 
ming project somewhere between 50 and 
200 and 1 ,000 lines of code, you start 
losing control." 

"C just doesn't have all of the things 
that you need for modularization, strong 
checking, and soon. It's evolving in that 
direction, but it's got its weaknesses. 
Today certain dialects of Pascal are 
becoming fairly powerful too. The trouble 
with Pascal is that in order to meet those 
requirements it has to be extended, and 
nobody seems to have agreed on which 
extensions yet. 

"Ada is still out, of the starting gate. If I 
had to do a large project commercially, I 
would do it in structured COBOL. If I felt 
the demand for performance were too 
great. I might switch to PL/I but probably 
to C," says Plauger. 

Bell Labs is preparing to introduce an 
enhanced version of C, called C+ + , 
which, according to Plauger, "has a lot of 
bright ideas tacked on. But it's not com- 
pelling to me that's the best thing to do to 
C yet. Certainly a lot of good ideas that 
are missing in C can be found in Ada. Ada 
is full of a lot of things, it's just too big a 
language. I think right now programming 
in C, with tighter discipline, is what we're 




going to be relying on to carry us through 
the next few years," says Plauger. 

ilauger's five-year 
stint with Bell 
Labs did not end 
on the best of terms. In 1974, the woman 
who he was married to at that time filed 
charges of sex descrimination against Bell 
Labs, and Plauger decided to support her 
in her suit against the company because he 
felt her claims were justified. 

"I think that because 1 was so out- 
spoken in encouraging her to oppose the 
company made it hard for people to 
want to keep me on at Bell Labs," he says. 
"Let's face it, I didn't have the person- 
ality to understand how to work well in an 
organization of that size. I had a chance to 
leave under my own steam before I got 
run out of town on a rail, so I took it." 

Plauger left Bell Labs in 1975 to 
work for Yourdon Inc., a seminar and 
book publishing company based in New 
York, N.Y. Ed Yourdon, founder of the 
company, had created a strong reputation 
worldwide for being an author of 
important books on programmer 
productivity. 

"I'd say I went to Yourdon with a head 
full of ideas about programming tools," 
he remembers. "When the opportunity 
came up to actually write a C compiler, I 
was quite confident that I could do it even 
though I hadn't written a whole C com- 
piler before." 

But Plauger soon left Yourdon to start 
his own company on the kitchen table of 
his apartment on New York's Manhattan 



YOUR CODE MAY BE WASTING ITS TIME! 
THE PROFILER™ CAN HELP . . . 

• Statistical Execution Profiler • Time critical code optimization 

• Works with any language • Abnormal code behavior tracking 

• Completely configurable • Graphic presentation of results 

• Up to 16 partitions in RAM/ROM • Easy to use menu interface 

THE PROFILER is a software package which gives you, the programmer, a powerful tool for locating 
time consuming functions in your code and allows you to performance tune your program. With 
the THE PROFILER you can determine where to optimize your code for maximum benefit, then measure 
the results of your efforts. 

Using THE PROFILER, you can answer questions like: 
Where is my program spending its time? 
Why is my program so slow? Whal is it doing? 
Is my progam I/O bound? CPU bound? Are data buffers large enough? 
How much improvement did my changes make? 
THE PROFILER is completely software based and consists of a system resident driver and a monitor 
program. The memory partitions can range from 1 byte to 1 megabyte in size and can be anywhere 
in the address space. 

NO ADDITIONAL HARDWARE IS REQUIRED! 
Requires an IBM PC or compatible system with a minimum 64k 
and one drive. 

THE PROFILER is available for $125.00 from DWB Associates or 
ask your software dealer. To order or for more information, call 
or write DWB Associates. VISA/MC accepted. Dealers welcome. 

IBM is a trademark ol IBM Corp. MSD0S is a trademark Of Microsoft Corp 
THE PROFILER is a trademark of DWB Associates. 



€0 

dwb 

Aliaclati a 



P.O. Bo* 5777 
EJeavertoi\ Oregon 97006 
(503) 629-9645 



CIRCLE 20 ON READER SERVICE CARD 



23 



island. Ho called the company White- 
smiths because it had a certain Old World 
sound to it. "We wanted to call to mind 
the old craft guilds almost back in the 
Middle Ages, certainly the early Renais- 
sance," says Plauger. 

Even the company logo— which shows 
a hand holding a ink quill pen in front of a 
collection of different lettering styles 
spanning thousands of years— can be seen 
both as an ancient Roman seal and a cath- 
ode ray tube. 

"I have learned to think of program- 
ming not so much as an art but as a craft, 
meaning a more pragmatic art form."' he 
says. "Certainly you don't write a pro- 
gram and just have everyone stand around 
and admire it." 

Since that time, Plauger's company has 
written C compilers that stretch from the 
small, 8080-based microcomputers to the 
IBM 370. Most of their customers, he 
claims, depend on the fact that White- 
smiths is able to bridge such a broad range 
of systems and environments with a uni- 
form language. 

"Let's face it. 1 started this company 
because I like writing code and showing 
the world that you could really produce 
high-quality code that is marketable. I 
think we've done that," says Plauger. 
"Now I'm learning how to be a 
businessman. 

"When you own your own company it 




just tends to cat you up. " he says. "I do 
pride myself on being a writer, but I've 
had little time for that lately. And if you 
ask me what I do for a living, I'd say I'm a 
programmer." 

| ot only is Plau- 
ger the head of 
his own 

successful software company, but he's 
also a talented science fiction author. He 
won the John W. Campbell Award for best 
new science fiction writer of the year in 
1975. His story "Child of All Ages," 5 
originally published in Analog , has been 
widely anthologized and has been 
optioned for television. His novel. Fight- 
ing Madness,'' and several other short sto- 
ries have been published by Analog and 
other magazines. 

Plauger emulates the prose style of 
C.S. Forrester in his fiction, just as he 
models his technical writing after 
Asimov. He prefers to write in a clean and 
straightforward way, without forcing his 
readers to "bump their shins on the big 
words or funky grammar." as he puts it. 
"When you write science fiction, you 
can't snow people with fancy terminology, 
you have to sell a story about people." 

Plauger now lives in a beautiful Early 
Victorian house in Concord, Mass.. and 
spends most of his life with his family 
shuttling back and forth between this 



home and another lakeside home in New 
Hampshire. Above all, he says he enjoys 
watching his five-year-old son, Geoffrey, 
growing up. 

Aside from programming and running a 
company, Plauger practices piano daily 
and manages to get in a jog every day as 
well. "I'm a runner just forthe pleasure 
of it, enough to keep my heart ticking well 
and let me eat extra dessert." 

As a multitalented individual, with 
interests spanning from the artistic to the 
pragmatic, Plauger certainly qualifies as 
one of the more fascinating Renaissance 
people in our computing industry today. 

References 

1. KernighLin. Brian W. and Plauger, P.J. The 
Elements of Programming Style. McGraw- 
Hill Book Co.. New York, N.Y., 1974. 

2. Kcrnighan, Brian W. und Plauger, P.J. Soft- 
ware Tools. Addison-Wcslcy Inc., Reading, 
Mass., 1976. 

3. Kcrnighan. Brian W. and Plauger, P.J. Soft- 
ware Tools in Pascal. Add i son-Wesley Inc.. 
Reading. Mass.. 1981. 

4. Kcrnighan, Brian W. and Ritchie. Dennis 
M. Vie C Programming Language. 
Prentice-Hall Inc., Englcwood Cliffs, N.J.. 
1978. 

5. Plauger, P.J, "Child of All Ages." Analog, 
(Nov. 1973). 

6. Plauger, P.J. "Fighting Madness." Analog 
Annual (1976). 

Craig LaGrow is the editor of 
COMPUTER LANGUAGE. 



SMALL rFDRIBFFPG 



Small-C CompilerVersion 
2.1 for PC-DOS/MS-DOS 
Source Code included 
forCompiler& Library 
New 8086 optimizations 
Rich I/O & Standard Library 



CBUG SOURCE LEVEL DEBUGGER FOR SMALL C 

Break, Trace, and Change 
variables all on the 
source level 
Source code included 




Datalight 

11557 8th Ave. N.E. 
Seattle, Washington 98125 
(206)367-1803 

ASM or MASM is requited with compiler 

i ncl ude d isk size < i 60k/3 20ki, and DOS versi on with order 

visa & MasterCard accepted Include card no & expiration date 

Washington state residents include 7 9% sales tax 

IBM-PC & PC-DOS are trademarks of international Business Machines 

MS-DOS is a trademark of Microsoft Corporation 

CIRCLE 19 ON READER SERVICE CARD 

24 COMPUTER LANGUAGE ■ FEBRUARY 1985 



Only $95 with FULL SOURCE CODE! 
"... an incredible learning tool," Byte 

For only S95. Q/C is a ready-to-use C compiler for CPM with com- 
plete source code. Heres what BYTE (May 19841 said. "Q-'C has 
a portable library and produces good code quality. If you want to 
learn compiler construction techniques or modify the standard lan- 
guage. QC is the obvious choice 

• Source code for compiler and over 75 library functions 

• Strong support for assembly language and ROMs 

• No license fees for object code. 

• Z80 version takes advantage of Z80 instructions. 

• QC is standard. Good portability to UNIX 

Q'C has casts, typedef. sizeof. structure initialization, and function 
typing. It is compatible with UNIX Version 7 C. but doesn I support 
long integers, float, parameterized Adelines, or bit fields. Call about 
our new products: Q C profiler. Z80 code optimizer, and Z80 as- 
sembler and virtual linker, all with full source code! 



miCODE 

WORKS 



5266 Hollisfer Suite 224 
Santa Barbara. CA 93111 
(805) 683-1585 



QC CP M. Z80 ana UNIX art? trariemFsrks ol Oualiiy Compulei Svslems Digital 
Research Zilog Inc and Bell Laboratories respectively 

CIRCLE 42 ON READER SERVICE CARD 



LOMAS DATA PRODUCTS INVITES YOU TO: 



SHARE THE THUNDER. 

t ii 



The S100-PC -TM offers the 
following standard features: 

High performance THUNDER 186 8Mhz 
80186 processor 

512K bytes of RAM (expandable to 1Mbyte) 
4 serial ports to support up to four users 
3 Centronics compatible parallel ports 
Concurrent DOS operating system 
allows execution of both CP/M-86 and 
MS-DOS (PC-DOS) programs 
i . 5V4" IBM-PC compatible floppy drive 

40 Mbyte high performance Winchester drive 
Attractive 10 slot desktop enclosure 

In addition, a number of options are available including: 
larger Winchester drives, more user ports, 80286 proces- 
sor, graphics support and additional operating systems 
(MS-DOS and CP/M-86). 

S100 BUS boards products & support 
for the system integrator . . . 

All of LDP boards are fully tested to exacting standards 
and carry a one year warranty. We specialize in 16-bit 
products & support the major operating systems for 16-bit 
processors: CP/M-86*, CONCURRENT CP/M-86*, and 
MS-DOS (PC-DOS). 

■ THUNDER186 — THE ONLY COMPLETE S100 BUS, 
16 BIT SINGLE BOARD COMPUTER AVAILABLE 
TODAY. 

Concurrent CP/M-86, which in addition to running CP/M-86 
programs, runs MS-DOS programs. Comes complete, 
ready to plug into an enclosure and run. 2S6K bytes of 
RAM only PRICE $1595.00 

■ LIGHTNING ONE***8086/8088 CPU 

8086 or 8088, with 8087 and 8089 coprocessors. Up to 10 
MHZ operation PRICES start at $425.00 

■ HAZITALL SYSTEM SUPPORT BOARD 

2 serial, 2 parallel ports, battery protected clock calendar. 
Hard disk controller host interface PRICE $325.00 

■ LDP 128/256K DYNAMIC RAM 

Advanced dynamic RAM with LSI controller for failsafe 
operation, parity PRICE 128K— $495.00, 256K— $795.00 

■ RAM67 HIGH PERFORMANCE STATIC RAM 

High speed (100ns) low power CMOS static RAM. 128K 
bytes, extended addressing PRICE $995.00 

■ LDP72 FLOPPY DISK CONTROLLER 

Single/double density, single/double sided disks, both 8" 
and SW" inch drives simultaneously PRICE $275.00 

■ LIGHTNING 286— 80286 CPU BOARD 

Offers 4 times the performance of a 5MHZ 8086 CPU while 
maintaining software compatibility PRICE $1395.00 

■ OCTAPORT 8 PORT SERIAL BOARD 

to 19200 baud operation real time clock interrupt. Ideal 
for multi-user systems such as MP/M-86* PRICE $395.00 

S100-PC-TM is a trademark at Lomas Data Products, Inc. 
*CP/M-86, MP/M-86 and CONCURRENT CP/M-86 are trademarks ot 
Digital Research. **MS-DOS is trademark of Microsoft. 
***Lightning One is trademark of Lomas Data Products, Inc. 




LOMAS DATA PRODUCTS, INC. 

66 Hopkinton road, Westboro, MA 01581 
Tel: (617) 366-6434 □ Telex: 4996272 

Dealer inquiries invited. 

For orders outside the U.S., contact 
our exclusive dealers: D Australia — 
LAMRON PTY. LTD., (02) 85-6228 
D Malaysia — EXA COMPUTER (M) 

SENDIRIAN BERHAD, 795284 



CIRCLE 54 ON READER SERVICE CARD 



Standardization 





By Jim Brodie, chairman of C Programming Language Standards 




he C program- 
ming language 
has become 
widely accepted 
as one of the leading choices for a variety 
of applications, including systems pro- 
gramming (such as operating systems and 
compilers), industrial real-time control 
applications (such as telephone switching 
systems and process control), and even 
general applications (such as text editors, 
data base systems, and spreadsheets). 
This widespread interest and use in 
many environments has prompted the 
development of a standard to enhance the 
portability of C programs by precisely 
specifying the language, library, and envi- 
ronment requirements of C. 

In this article I will discuss a little of the 
history behind this standardization effort, 
the goals and working principles of the 
standards committee, and how the lan- 
guage currently being defined by the stan- 
dard committee is different from the exist- 
ing de facto standard for C. I will not 
address the standard activities related to 
the library or environment. 

Why a new standard? 

The C language has a de facto standard 
definition in Tlie C Programming Lan- 
guage by Brian Kernighan and Dennis 



Ritchie (affectionately known as K&R in 
C programming circles). The language as 
described in K&R has been the starting 
point for almost every C translator (com- 
piler or interpreter) in use. 

Despite the high quality of this book, 
considerable divergence has occurred in 
the C translator implementations where 
language and library features or proper- 
ties were ambiguously or imprecisely 
defined (or simply not defined at all) . In 
addition, the language has grown in vari- 
ous directions as it has matured, and user 
requirements and language weaknesses 
have been identified. Unfortunately these 
extensions to the C language have varied 
significantly across C translator 
implementations. 

Because of the variations in the differ- 
ent dialects of C, the portability of C 
programs — one of the often noted 
strengths of C— has suffered. 

It became clear a need existed to define 
a standard that would establish a precise 
definition of what C translators should 
accept and what C programmers could 
count on when trying to write portable 
programs. This led to the formation of the 
C Programming Language Standards 
Committee (labeled X3J1 1) under the aus- 
pices of the American National Standards 
Institute (ANSI). 

The standards committee, which is 
made up of volunteer representatives from 
a wide cross section of industry, aca- 




26 



COMPUTER LANGUAGE ■ FEBRUARY 1985 



demia, and C users, was formed in June 
1983. The committee meets four times a 
year in one week sessions to formulate the 
new standard that will be presented to the 
C community for comment and, if satis- 
factory, approval. 

The primary goal for the standards 
committee is to codify existing practice. It 
is not in the committee's charter to 
develop a significantly different language 
with many new features. Much of the 
work of the committee centers around 
determining what is existing practice and 



trying to resolve the differences when 
existing practice is inconsistent or 
contradictory. 

The committee feels strongly that the 
resulting standard should enhance the por- 
tability of C programs. The committee 
uses the rule of "the fighting chance" — it 
is striving to develop a standard that does 
not force a C programmer to write por- 
table programs (the low-level, machine- 
dependent features of C are part of its 
strength) but at least gives the program- 
mer a fighting chance of writing a por- 
table program if good programming prac- 
tices are followed. 




Maintaining the Spirit of C is also high 
on the list of the committee's goals. Some 
philosophical principles underlie the 
original design of the C language. The 
committee is striving to ensure that the C 
language it defines stays very close to the 
principles that made C successful in the 
first place. Some of these principles could 
be summarized in phrases like "Trust the 
programmer and allow the programmer to 
do what needs to be done," "Keep the lan- 
guage small and simple, and "Make 
it fast, even if it is not guaranteed 
to be right." 

This last principle may need a little 
explanation. Many operations are defined 
to be "how the target machine's hardware 
does it" rather than by some general rule. 
For example, the size of [he basic integer 
variable type, im , is defined to be the nat- 
ural (read fastest) integer size for the 
machine. Another example is that C does 
not define whether there is zero fill or 
sign fill when an object is shifted to the 
right'. It is allowed to be whatever is fast- 
est and easiest on the particular target 
machine. 

The astute reader may have noticed that 
the goals of allowing the writing of por- 
table programs and permitting machine- 
defined features arc frequently 
diametrically opposed. A significant part 
of the committee's work is determining, 
on a case-by-casc basis, how the language 
can be defined so that each of the goals is 
reached in a reasonable way. 

The committee is also working to 
define a standard that will break as little 
currently working code as is reasonably 
possible. It has generally been accepted 
that every translator will need to be mod- 
ified to meet the requirements of the 
emerging standard. However, it is the 
committee's hope that only a small subset 
rewritten to be accepted by a standard 
conforming translator. 

Other goals, including a desire for 
semantic precision, internal consistency, 
simplicity, and reliability, are also consid- 
ered when trying to evaluate alternative 
approaches and solutions before the com- 
mittee. These goals often come into play 
when considering possible extensions to 
the C language. 

Changes to K&R 

The language portion of the standard is 
being derived from Tlie C Reference Man- 
ual by Dennis Ritchie, an early version of 
which was published as Appendix A of 



27 



Vie C Programming Language . In the 
remainder of this article I will outline 
some of the differences between the cur- 
rent draft of the standard and the language 
as defined in K&R. 

It should be noted that the draft is not 
final and that the committee may change 
its position on any of the features 
described here. It is not possible to give a 
final definitive list of language changes 
and features since the committee remains 
undecided on several fundamental and 
many peripheral issues. 



Despite this caveat, the features 
described here will probably be in the 
draft proposed standard submitted for 
approval unless a significant amount of C 
community feedback is received indi- 
cating that the committee has made a 
mistake. 

Current practice is not limited to the 
language as defined in K&R. Many 
changes have become common across a 
wide variety of C implementations. 

Many of the current implementations of 
C translators have established slightly 
stricter rules for combining objects of dif- 



funcK) 

{ 

int addr=1234; 

char * cp; 

cp = addr; /* incorrect */ 

cp = (char *) addr; /* correct */ 

Listing 1. 

struct firstst 

( 

int fl; 
long si; 

1; 



fcrent types in C expressions. This change 
is also reflected in the standard. For 
example, integers (with the exception of 
0) can no longer be assigned to a pointer 
variable unless an explicit cast 
is supplied. Listing t shows an example of 
how this requirement affects the writing 
of code. 

The standard also follows common, cur- 
rent practice by extending the use of the 
unsigned type modifier to char , short , 
and long variables (K&R only defined 
unsigned int). 

The requirement that names of mem- 
bers of structures and unions be unique 
across the entire program has been lifted. 
Now each structure defines its own name 
space, which means that member names 
may be reused in different structures 
without conflict. 

Structures assignment as well as pass- 
ing structures as arguments and having 



struct simplst 

{ 

int si; 

short s2; 

}; 



/* no name conflict with firstst. si */ 



struct simplst strl , str2; 

struct simplst stf unc( ) ; /*declare a function returning a structure */ 

func( ) 

str2 = strl; /* structure assignment */ 

strl = stfunc(str2) ; /* function with a structure argument, */ 

/* returning a structure value */ 



Listing 2. 

28 COMPUTER LANGUAGE ■ FEBRUARY 1985 



functions which return structures are also 
included in the standard. Listing 2 demon- 
strates how code that uses these features 
would look. Note that the assignment of 
the structure variable strj to str2 causes 
the contents of sir] to be copied into str2 . 
This is not just a copying of pointers to the 
structures. Future modifications to mem- 
bers of strJ will have no effect on the con- 
tents of str2 . 

The type void has been included to 
allow the specification that a function 
does not return a value (i.e., is a pro- 
cedure). This allows a programmer to be 
more precise in specifying the correct use 
of a function. 

The listing below demonstrates several 
uses of void. The declaration of the func- 
tion yfitnc uses void to specify that this is a 
function that returns no value. This is con- 
trasted with the declarations of Ifunc , 
which returns a long int and ifunc which 
returns an int (by default). 

void vfuncQ; 
long int IfuneQ; 
ifunc {); 
main() 

( 

vfuncQ; 

(void) IfuncQ; 

The main program in this example 
invokes the void typed function vfimc as a 
procedure that returns no value. The use 
of void in a cast is shown in the last state- 
ment in main . Here the void cast is used to 
show that the long value returned by Ifunc 
is being explicitly ignored after this call. 
While the use of the cast in this situation is 
not required by the standard, it does allow 
for the writing of programs that are 
clearer and more maintainable. 

Simple enumerated types have also 
been included. It should be noted that the 
enumerated types of C are significantly 
different than those supplied in some 
other languages, notably Pascal. Enumer- 
ated type variables are treated by C as 
simple integer variables, and no prede- 
cessor or successor functions are sup- 
plied. It is also possible to control the val- 
ues of each of elements in the enumeration 
list. For example, in Listing 3 the enu- 



meration constants apple , grape , pear , 
and orange have the values 0, 1,4, and 5, 
respectively. The assignment causes 
myjuice to have a value of 4. 

The last line of Listing 3 emphasizes 
the integer nature of enumerated type 
variables. The variable myjuice is decre- 
mented by one (using the operator). 

Myjuice now contains the value 3 . not the 
value I . No special processing is done to 
limit the values held by an enumerated 
type variable to those in its enumeration 
list. 

The rules for identifiers have been 
changed slightly. Identifiers continue to 
be of an arbitrary length: however, inter- 
nal identifiers (e.g., auto and static vari- 
ables) may now be significant anywhere 
in the first 3 1 characters (as opposed to 
eight in K&R). External identifiers (e.g., 
global variables and non-static functions) 
are more restricted due to the large num- 
ber of implementations that have assem- 
blers, linkers, and other language-related 
utilities that can not support long names. 

Conforming implementations are only 
required to support external identifiers 
(global variables and non-static func- 
tions), which arc single case and signifi- 
cant in the first six characters. Imple- 
mentation., can, of course, allow a greater 
number of :>ignificant characters in an 
external identifier. 

The committee has also clarified the 
rules in several areas where various 
implementations had taken different 
approaches. One area that falls into this 
category is the "writability" of strings. 
Some current implementations view 
strings as constants that cannot be mod- 
ified (and put into ROM, if useful). Oth- 
ers view them as an array of characters 



func2 () 

( 

enum fruit (apple, grape, pear=4, orange}; 

enum fruit myjuice; 

myjuice = pear; 
— myjuice ; 

Listing 3. 



that can be modified just as any array can 
be. 

The current draft of the standard speci- 
fies that strings are constants and are not 
writable. It is allowable for a translator to 
supply writable strings as an extension to 
the language, however, portable programs 
should not use this extension. 

Considerable variety in imple- 
mentations has occurred in the area of 
macros. A fairly common practice in this 
area is "pasting" together tokens by elid- 
ing a comment between them. This prac- 
tice, shown in Listing 4, is based on the 
assumption that a comment can be 
replaced by nothing rather than white 
space as specified in K&R. This practice 
will not have the desired merging effect in 
standards conforming translators since 
the standard explicitly stales that com- 
ments are replaced by white space (e.g., a 
blank). 

Since the merging facility was viewed 
as useful, the committee defined a new, 
consistent syntax for token pasting on 
Mefine lines. This syntax uses a new ## 
operator (Listing 5). 

New rules and extensions 
In addition to the noted changes as a result 
of common existing practice and clari- 
fications, the committee has established 
some new rules and added several exten- 
sions to the C language to meet specific 
well-defined needs. 

The most ambitious extension has been 
the addition of a facility, called function 
prototypes, which allows the checking 
and conversion of function call argu- 
ments. This feature has been added to 
address the C language weakness that 
there was no way to ensure that actual 
function arguments were correct other 



29 



Old style of merging 

/* merge arguments a and b into a single token */ 
#define concat(a,b) a/**/b 

Listing 4. 



New style of merging 

/* merge arguments a and b into a single token */ 
#define concat(a,b) a # b 

Listing 5. 

int protol (long, char *, short); 
double proto2 (void) ; 
unsigned int oldfunc(); 

funcQ 

{ 

int abc; 

char * ep; 

short xyz; 

double dbl; 

abc = protol(abc, ep, xyz); /* abc is widened to a long */ 
dbl - proto2(abc); /* invalid function call */ 

Listing 6. 



main() 

{ 

unsigned char uc; 

signed char sc; 

char c; 

int abc; 

uc = '\377 f ; 
sc = '\377'; 
c = '\377' 



abc = uc; 
abc = sc; 

abc = c; 



Listing 7. 



/* assuming 8-bit char and two's complement/* 

/* abc becomes 255 */ 

/* abc becomes -1 */ 

/* depends on the implementation, */ 

/* either 255 or -1 */ 



than by tedious hand-checking. Some of 
the most difficult-to-find bugs are related 
to mismatched types between a function's 
parameters and the actual arguments on 
the function call. 

The optional prototype facility allows 
the specification of a function declaration 
that includes type information for each of 
the parameters to the function. When 
present, it causes the translator to check 
each of the actual arguments on a function 
call. If the arguments match the corre- 
sponding parameter type in the prototype 
then nothing is done. 

If an actual argument has a different 
type, but is convertible to the correct type 
by the rules of assignment, then the code 
to do the appropriate conversion is added. 
For example, an int actual argument 
would be converted to a long if the corre- 
sponding argument in the prototype was a 
long . If the arguments are different and 
there is no valid assignment conversion 
(e.g., between int and structure type) then 
an error has occurred. 

Listing 6 demonstrates the declaration 
for several functions. Prow] is declared 
to be a function that returns int . It has 
three parameters which have types long , 
pointer to char, and short . respectively. 
Protol is declared to be a function, 
returning a double. It has no parameters 
(note the use of the void keyword). Oid- 
fiinc is defined as a function that returns 
unsigned short . This declaration does not 
contain any parameter type information, 
and therefore the traditional rules that did 
not include any checking or conversion 
apply on the calls to oldfitnc . 

The function calls made in June will be 
handled as follows. Thecal! to protol will 
be checked. It will be determined that abc 
is of type ml and that the prototype calls 
for a long . The appropriate conversion 
code will be generated. The other argu- 
ments match, therefore no additional spe- 
cial work is required. The call \aproto2 
will be checked, and since the prototype 
says there are no arguments and the call 
has an argument, the call is invalid. 

There are several places in C where the 
sign of a value is allowed to be whatever is 
fastest for the compiler to generate. This 
is seen when char and bit field values are 
widened to integers during expression 
evaluations. In these cases it is 
implementation-defined whether a value 



30 COMPUTER tANGUAGE ■ FEBRUARY 1985 



[hat has the high-order bit set results in a 
positive or negative integer value. 

This freedom for implementors allows 
for efficient code generation but causes 
problems when the signedness of a char or 
bit field value is important when writing 
portable programs. This problem has 
been addressed with Ihe addition of the 
type modifier, signed, to the language. 

The signed type modifier guarantees 
that the translator will view the bit pattern 
in the char variable or bit field as repre- 
senting a signed value. Listing 7 shows an 
example of the three types of signedness 
that char variables can take on. Assuming 
an 8-bit char, the assignment of " \377" 
(octal 377) will set all of the bits in each of 
the variables. 

However, when these variables are used 
(e.g., widened during the assignment to 
an integer variable), they are interpreted 
in different ways. The unsigned char is 
guaranteed to take on only zero and posi- 
tive values. The signed char includes both 
positive and negative values. The "plain" 
char has an implementation-defined 
range. However, since implementations 
are allowed to select the fastest widening 
available in the hardware, plain char is an 
appropriate choice when the signedness of 
the value is not important (e.g., when it 
will only hold printable characters). 

Two new type modifiers have also been 
added to the C language: const and vol- 
atile . The const modifier has been added 
to allow the specification that a data item 
will not be changed during the course of 
the program. This information is particu- 
larly valuable in small environments 
where constant data could be placed in 
ROM, if desired. 

The presence of the const modifier 
causes the compiler to check for the 
invalid direct assignment, incrementing, 
or decrementing of the const object. Indi- 
rect attempts to modify const objects via 
pointers cause undefined behavior that the 
compiler is not required to diagnose. 

The code fragment in Listing 8 shows 
how definitions using the const type mod- 
ifier would look. The first line declares a 
constant xyz with a value of 24. Next, the 
constant array arr is defined and initial- 
ized. Const objects should always be ini- 



tialized since modifications are not 
allowed in the body of the code. 

The volatile type modifier indicates to 
the compiler that this object may be mod- 
ified in ways unknown to the translator. It 
prevents the translator from optimizing 
any expressions that use this object. This 
has been added to address the need, in 
many microprocessor environments, for 
the adequate handling of memory mapped 
I/O. 

In a memory mapped I/O system, a read 
or write of a location may cause special 
side effects, even though the statement 
appears pointless or unnecessary from the 
C code point of view. 

The code fragment that follows defines 
and uses the volatile object iomem. If 
iomem had not been volatile, the translator 
would have been free to eliminate the first 
assignment to iomem since there is no use 
of iomem before it is assigned a new value 
in the second statement. Since iomem is 
volatile, this possible optimization is not 
allowed. This preserves the special 
semantics that may be associated with 
repeated writes to memory mapped I/O 
location. 

main () 

( 

volatile char iomem; 
iomem = 0; 
iomem = 1; 

An important benefit of the volatile 
modifier is that it frees the translator to do 
sophisticated optimizations when it is not 
present. 



This previous discussion has been a 
brief overview of the language-related 
work which is currently going on in the 
standards effort for the C programming 
language. I have not presented all of the 
changes and features that people will find 
new and different in the standard. How- 
ever, I have tried to cover some of the 
major areas of change and to explain the 
underlying goals and principles that have 
guided all of the changes. 

People interested in becoming involved 
in the standards activity or in obtaining a 
copy of the working document which, 
when complete, will become the draft 
proposed standard should contact either: 

Jim Brodic 

Motorola Microsystems 
2900 South Diablo Way 
Tempe, Ariz. 85282 
(602)438-3456 

or the committee vice chair: 

Tom Plum 
Plum Hall 
1 Spruce Ave. 
Cardiff, N.J. 08232 
(609)927-3770 H 



Jim Brodie has an M. S. in computer sci- 
ence from Arizona State Univ. , Tempe, 
Ariz. He currently works at Motorola in C 
compiler development. He convened the C 
Programming Language Standards Com- 
mittee and is its chairman. 



const short xyz = 24; 

const int arr[4] = {188, 996, 44, -17); 




func () 

{ 

int abc; 






abc = xyz + arr[3]; /* appropriate use of constants 
xyz =10; /* invalid use of a constant */ 
arr[2]++; /* invalid use of a constant */ 


*/ 



Listing 8. 



31 




i We have over 200 
complete, tested, and, documented functions. 



All source code and demo programs are included. 






The library was specifically designed for software 
velopment on the IBM PC, XT, AT and compatibles. There are no royalties. 

Over 95% of the source code is written in C. Experienced programmers 



can easily "customize" functions. Novices can learn from the thorough comments. 



louwmivi mnnuon^ 




RARY includes: 



i Screen Handling Available Windows *> Full Set of Color Graphics 
unctions Better String Handling Than Basic i DOS Directory and File Man- 
gement Execute Programs, DOS Commands and Batch Files i Complete 
ieyboard Control Extensive Time/Date Processing i Polled ASYNC 
:ommunications General DOS/BIOS gate And More ' 



and DeSmet. 



. rosoft, Computer Innovations, Mark Williams 



C Compilers: Lattice C— $349, Computer Innovations C86— $329; Mark Williams C— $449. 

C UTILITY LIBRARY $149 

Order direct or through your dealer. Specify compiler when ordering. Add $4.00 shipping for 
UPS ground, $7.00 for UPS 2-day service. NJ residents add 6% sales tax. Master Card, Visa, 
check or P.O. 



| ESSENTIAL SOFTWARE, INC 

P.O. Box 1003 Maplewood, New Jersey 07040 914/762-6605 

CIRCLE 27 ON READER SERVICE CARD 



32 COMPUTER LANGUAGE ■ FEBRUARY 1985 



I 



J 



C Instead 




FORTRAN? 



By Anthony Skjellu m 




ne of the most 
prevalent top- 
ics for dis- 
agreement 
between programmers is the choice of 
programming language. Many articles 
discuss the relative merits and demerits of 
various languages, and some authors 
make invidious comparisons to show that 
their own favorite language is belter than 
the rest. 

While many of these articles are quite 
informative, they usually fail to bring out 
how the application affects the choice of 
language. For example, one would nor- 
mal ly choose a data base language for data 
base management applications as opposed 
to a general-purpose language like BASIC 
or Pascal. 

Through examples this article attempts 
to illustrate why the C programming lan- 
guage works well for scientific and 
engineering applications. Before begin- 
ning, some background comments are in 
order. 

Traditionally, scientific and engineer- 
ing applications have depended very heav- 
ily on FORTRAN as the source language. 
FORTRAN was introduced early in the 
computer age. It subsequently became 
widely available, and the language 
afforded some portability between differ- 
ent hardware. FORTRAN became popu- 
lar with scientists and engineers. 

For many of these programmers, the 
concept of programming begins and ends 
with FORTRAN. Unfortunately, FOR- 



TRAN did not provide a programming 
environment that was conducive to struc- 
tured, modular programming. 

Furthermore, the intense connection of 
intrinsic functions to the compiler often 
forced programmers to resort to complex 
programming tricks. Many programmers 
became experts on writing tricky pro- 
grams instead of programs that could be 
easily maintained, enhanced, or 
understood. 

In all fairness, FORTRAN has under- 
gone some face-lifts to include structured 
programming additions. But many pro- 
grammers avoid these new features 
because they are not supported uniformly 
on different machines. Thus, traditional 
FORTRAN 66 has remained the standard 
form for programs. 

New scientists/engineers automatically 
learn FORTRAN because that is the lan- 
guage they'll encounter in industry. A sort 
of vicious circle exists. Part of the prob- 
lem is that students taught FORTRAN in 
an engineering/scientific setting often 
don't learn to carefully distinguish their 
FORTRAN code from an underlying 
algorithm. 

No computer language can force the 
user into a perfect mold. The importance 
of a structured computer language is that 
it should make modular programming a 
comfortable, natural effort. At the same 
time, it shouldn't be so rigid that the pro- 
grammer must work around language fea- 
tures and restrictions. 

C satisfies these requirements as a 
structured language. It has the additional 
advantage that it is widely available with 
essentially no dialects. The standard 
library defined for C varies somewhat 
from implementation to implementation, 



but a good level of software portability 
exists. 

We now turn to illustrations of the con- 
venience and versatility of C in our appli- 
cation area. 

Learning to program in C 

An important aspect of programming is 
the language learning phase. C turns out 
to be easy to learn, although advanced 
features involving pointer arithmetic often 
are not learned at first. Fortunately, quite 
a bit can be done with just a few keywords 
and knowledge of a minimum number of 
library functions. Table 1 contains a list of 
keywords and functions useful when first 
learning C. 

The relative ease of learning C is attrac- 
tive for engineering and science students. 
If necessary, rudiments of C program- 
ming can be included as part of a second- 
ary or college semester course, and stu- 
dents can learn the language 
incrementally as they develop programs. 
(It is also worthwhile to require modular 
program design and good documentation 
as part of the programming task.) 

If C programming is used with several 
courses in a curriculum, students can 
gradually build a considerable knowledge 
of application programming in their field 
without taking specific programming 
courses. 

In certain instances, students should 
learn to deal with software/hardware 
interfacing as part of course work. In 
many circumstances, however, this is 
avoided because students don't have time 
to learn assembly language in an 
engineering course. 



33 






However, since C handles address cal- 
culations and binary logic with case, a 
small assembly-level nucleus could be 
prepared by the instructor, with students 
developing the bulk of the code in C 
instead of in assembly language. This 
would allow students to get hands-on 
experience they would otherwise miss. 
Development would be much less painful 
and time-consuming. This approach is 
feasible in a majority of cases, and it can 
often be used in practical applications 
also. 

With all these comments behind us. 
let's turn to some example programs. 
They are designed to convey some of the 
flavorof C. 

Example no. 1 

Imagine the following problem. We need 
to develop a bisection method algorithm 
that can be applied to several distinct real 
functions within a program. The bisection 
method is a robust means for finding 



zeros of functions. For example, if our 
function were 

f(x) = x- 1.0 

then there would be exactly one zero, 
namely whcn.v is equal to one. In more 
interesting cases, we often can't deduce 
the answer by inspection. (For more spe- 
cifics on this method, consult Figure 1 .) 

In such cases, we need a function to 
find the desired zero or zeros. Such a pro- 
gram is depicted in Listing 1 . (All listings 
referred to in this article are available in 
electronic form. You can download them 
either from the COMPUTER LANGUAGE 
Bulletin Board Service— (415) 
957-9370— or take them from 
COMPUTER LANGUAGE \s account on 
CompuServe by typing "GOCLM".) 

Our function _bisea() will find zeros of 
the function called /(j . which we would 
define elsewhere in our program. Some 
valid examples for /(J are presented in 
Listing 2. An example call to _bisectQ 
might be the routine in Listing 3 . 



As we defined our task, we'll want to 
use a bisection method on more than one 
function. For example, we might want to 
perform bisection on three functions: /() , 
g() , and h() . To do so, we could write 
three versions of the _bisectQ function. 

This would work but is unnecessary and 
also a repetition of effort. To avoid this, 
we make the function under evaluation an 
argument to a more general function 
called biseclQ , which we present in List- 
ing 4. A valid calling sequence to this new 
routine might be as presented in Listing 5. 

The importance of this improvement 
should not be missed. Wc have gener- 
alized the function to the point where il 
can be applied like a mathematical oper- 
ator. That is, the function to be worked on 
is part of the argument list. Thus, bisect 
operates on the function specified over the 
interval selected. 

C provides the ability to use functions 
as arguments through the concept of 
pointers to functions. The name of a func- 
tion without parentheses is an address. So 



Basic keywords and 
functions in C 


Keywords 


Use 


for 


Used lor looping 
structures 


break 


Break from looping 
structures 


continue 


Continue ot start of 
loop 


if . . . else 


Conditionals 


return 


Return a value from a 
function 


inl 


Define integer type 


float, double 


Define real single, 
double precision types 


Functions 


Use 


exilfl 


Unconditional 
program termination 


printffj 


Formatted print 
function 


scanfj) 


Formatted input 
function 



Description of the bisection method 

Object 

Find a solution of f(x) = (to within a tolerance) given a continuous function f|x) on the 
closed interval [a,b]. The values f(a), f(b) must have opposite signs so that a zero exists in 
the interval [a,b]. 



Algorithm 


StepO: 


Step 1 : 


Step 2: 


5tep3: 


Step 4: 



Table 1. 

34 COMPUTER LANGUAGE ■ FEBRUARY 1985 



Step 5: 

Figurel. 



See if f(a), f(b) have opposite signs if not, print error message and 
abort program 

Compute c = (a + b)/2 

Compute t = f(c) 

If 1 1 1 < tolerance, we are done. Return c as the location of zero. 

Iff > Oandffb) > 

b = c 
If I > Oandf(b) < 

a = c 
IfKOandf(a) < 

a = c 
Iff < Oandf(a) > 

b = c 
This is the bisection of the interval 

Go back to step 2 




/* find a zero of f(x) */ 

/* limits */ 

/* convergence precision */ 



double _bisect(a,b,prec) 
double a,b," 
double prec; 

{ 

double fabs(); /* absolute value (standard function) */ 

double f(); /* this function returns double */ 

double curr; /* current point */ 

double temp_val; /* current value */ 

int cond; /* indicates condition of signs of problem */ 

if((f(a) <= 0.0)&&(f(b) >= 0.0)) 

cond =0; /* no reversal */ 
else 
if((f(a) > 0.0)&&(f(b) < 0.0)) 

cond - 1; /* reversal*/ 
else 



{ 



} 



printf("Illegal bisection request [%e,%e]\n",a,b) ; 
exit(l) ; 



while(l) 
( 



/* loop 'forever' *•/ 

curr = (a+b)/2.0; /* bisect interval */ 
temp_val = f(curr); /* get value there *./ 





if (fabs(temp_val) < prec) /* we are done */ 
break; 

if(temp_val < 0.0) 



} 

else 



if ( !cond) a = curr; 
else b = curr; 



} 



if ( !cond) b = curr; 
else a = curr; 



}7* end while(l) */ 
return(curr) ; 

} /* end bisectQ */ 



Listing 1. 



35 




the word "cos" specifies the address of 
the function cos() . The corresponding 
argument variable fit in the function 
bisectQ is defined as follows: 

double (*fn}(); 



This means that_/)i is a pointer to a func- 
tion which returns double precision real 
numbers. Whenever we write (*fii)(x) , we 
actually end up calling the originally 
specified function, i.e., cos(x). 

This provision is useful throughout pro- 



gram development. It is one of the most 
useful concepts of C. We can define very 
general functions and pass other functions 
to them to define their actual behavior in a 
particular instance. Programmers not 
only avoid repetitious coding but the 




double f(x) 
double x; 




return(x - 1.0); 



/* sin() function */ 
/* f(x) = sin(2x) */ 



double f(x) 
double x; 

{ 

double sin(); 
return(sin(2.0*x)) ; 

} 

double f(x) 
double x; 

( 

double temp = 0.0; 

double power = 1.0; 

int i; 

for(i = l;i < 6;i++) /* i loops from 1 to 5 inclusive */ 

temp = temp + power/((double)i)) ; 
power = power * x; 
} 

return(temp); /* f(x) = polynomial */ 






Listing 2. 



double y; 

y"= J>isect(l. 0,2.0, .0001); h 



range to search [1.0,2.0], 
zero tolerance is .0001 



*/ 



Listing 3. 

36 COMPUTER tANGUAGEB FEBRUARY 1985 



a 



double bisect(fn,a,b,prec) /* find zero of specified function */ 

double (*fn)(); /* function to find »zero of *■/ 

double a,b; /* limits */ 

double prec; /* convergence precision */ 

{ 

double fabsQ; /* absolute value (standard function) */ 

double curr; /* current point */ 

double temp_val; /* current value */ 

int cond; /* indicates condition of signs of problem */ 

if(((*fn)(a) <= 0.0)&&((*fn)(b) >= 0.0)) 

cond =0; /* no reversal */ 
else 

if(((*fn)(a) > 0.0)&&((*fn)(b) < 0.0)) 

cond = 1; /* reversal*/ 
else 

[ 

printf ("Illegal bisection request [%e,%e]\n",a,b) ; 

exit(l); 
} 

while(l) /* loop 'forever' */ 

( 

curr = (a+b)/2.0; /* bisect interval */ 
temp_val = (*fn)(curr); /* get value there */ 

if (fabs(terap_val) < prec) /* we are done */ 
break; 

if(temp_val < 0.0) 

{ 

if ( !cond) a = curr ; 
else b = curr; 

} 
else 

{ 

if ( !cond) b = curr; 
else a = curr; 



}/* end while(l) */ 

return(curr) ; 






} /* end bisect() */ 
Listing A, 



37 



DeSmet 
C 

8086/8088 

Development !>1f1Q 

Package lUSJ 



FULL DEVELOPMENT PACKAGE 

Full K&R C Compiler 

Assembler, Linker & Librarian 

Full-Screen Editor 

Execution Profiler 

Complete STDIQ Library (>120 Func) 

Automatic DOS l X/2.X SUPPORT 

BOTH B087 AND 
SOFTWARE FLOATING POINT 

OUTSTANDING PERFORMANCE 

■ First and Second in AUG '83 BYTE 
benchmarks 



SYMBOLIC DEBUGGER 



s 50 



Examine & change variables by 

name using C expressions 

Flip between debug and display 

screen 

Display C source during execution 

Set multiple breakpoints by function 

or line number 



DOS LINK SUPPORT 



s 35 



Uses DOS .OBJ Format 

LINKS with DOS ASM 

Uses Lattice-' naming conventions 



Check: □ Dev. Pkg (109) 
□ Debugger (50) 
D DOS Link SupL (35) 



SHIP TO: 



ZIP_ 



c 



WAR 



CORPORATION 



P.O. BOXC 

Sunnyvale, CA 94087 

(408) 720-9696 

All orders shipped UPS surface on IBM format disks. 
Shipping included in price. California residents add 
sales lax. Canada shipping add S5, elsewhere add 
S15. Checks must be on US Bank and In US Dollars. 
Call 9 am, - I p.m. to CHARGE by VISA/MC/AMEX. 



greater generality often makes the func- 
tions applicable for future purposes. Any 
greater effort in carefully coding such a 
function is rewarded by reduced effort on 
a future project. 

In introducing C. pointers to functions 
should be discussed early. Students should 
be taught how to use the device; expla- 
nation of addresses and pointers can wait 
until arrays have been introduced and 
understood. In this context, the concept of 
an address can be more easily motivated. 

In this first example, we have illus- 
trated an algorithm in its C incarnation, 
and we also introduced the idea of passing 
functions as arguments. When building 
software for scientific/engineering appli- 
cations, we are often faced with the need 
to perform operator-like procedures on 
functions we define. Often we have no 
analytical representation for the func- 
tions, so we must consider sonic sort of 
interpolation. The next example illus- 
trates how we can turn numerical data into 
a "black box" and thus simplify other 
computations. 

Example no. 2 

As a result of experimentation or numeri- 
cal computation we often obtain a set of N 
data points: 



yDJ 



1,2, 



N 



continuous. Once we do this, we can 
potentially use functions such as bisecrQ , 
which accept a continuous function as an 
argument. 

The quality of answers that this tech- 
nique produces depends heavily on the 
method of interpolation we use. For cer- 
tain applications, linear interpolation suf- 
fices. Listing 6 is a general linear inter- 
polation routine. This is the first step to 
placing our data in a black box. 

Given the general linear interpolation 
routine, we can create a function that 
appears to other routines as if it were con- 
tinuous. If an .vis requested outside the 
known interval, the interpolator will 
detect this and return 1 .0e300, which is 
nearly "infinity"* in double precision. 

Error handling must be performed at 
some level, but this is up to the program- 
mer. Listing 7 provides the outer level 
function, which uses linterpO on data 
arrays called xarrayQ and yarraylj . These 
arrays arc defined to contain npoint 
points. We have been careful to make 
linterpf) general so that it can deal with 
many different data arrays instead of just 
a specific pair. This makes life easy for 
the programmer. For example, inverse 
interpolation of the xarrayf} , yarrayfl , 
can be done without difficulty. To perform 
this new calculation, we need only change 
the line 

y - linterp(xorray,yarrcjy,x,npoints); 

of Listing 7 to the analogous form 

x = linterp(yQrray,xarray,y,npoints); 



From this data, we seek to obtain a con- 
tinuous functional relation of the form 
y =ffx) . Since we only know the relation 
between .r , y at N points, we have to inter- 
polate (or perhaps extrapolate) to get a 
value we require. If we are successful, we 
will be able to bury the discrete nature of 
our data within a function that appears 



double cos(); /* use cos() function for calculation */ 
double y; /* destination for answer */ 

y = bisect(cos,0.0,3. 14159, .0001); 

/* 

bisect cos() function 

interval [0.0,3.14159] 

zero tolerance .0001 
*/ 



CIRCLE 18 ON READER SERVICE CARD 
38 COMPUTER tANGUAGEB FEBRUARY 19B5 



Listing 5. 




/* 


*/ 


Linear Interpolation 


double 


linterp( x values , y values, x, points) 


double 


xvalues[]; /* source of x values (sorted) */ 


double 


yvalues[]; /* source of y values (sorted) */ 


double 


x; /* find y given this x */ 


int points; /* number of points */ 


I 


int i; /* looping variable */ 




double low_x,high x; /* used for tabular x values */ 




double low_y ,high_y; /* used for tabular y values */ 
double y; /'* temporary for result */ 




if((x < xvaluesfO]) (x > xvalues[points-l ] )) 

return(1.0e300); /* flag illegal result */ 




for(i = 0;i < points;i++) 

{ 

low_x = xvaluesfi]; 






high_x = xvalues[i+l] ; 




if((low x <= x) && (high x >= x)) 
r 




t 

low__y = yvaluesfi]; 

high_y = yvalues[i+l ] ; 

break; 
) 
} 

y = low__y + ((x-low_x)/(high_x-low_x))*(high_y-lowjj); 
/* formula for a straight line */ 




} 
/* 


return(y); 




*/ 





Listing 6. 



39 



mi 



as seen in Listing 8. By inverse inter- 
polation we mean that given a y value, we 
can find the corresponding.v (possibly not 
unique). Whether this is useful for spe- 
cific data depends on the nature of the 
data and the task at hand. Normally we 
would have to re-sort the data before 
attempting this so that y values became 
ordered lowest to highest. 

In this second example, we have shown 
how to build routines to most con- 
veniently structure discrete data within a 



program. This approach avoids many 
complications when using general rou- 
tines and will come in handy when per- 
forming many tasks in scientific/ 
engineering applications. Usually more 
sophisticated interpolation will be 
employed . These examples were included 
to show the point, not to solve the general 
problem. 

C can be used successfully for the type 
of applications considered in this article. 
Since it is readily available, powerful, and 



easy to learn, there is good reason to hope 
that many engineers and scientists will 
find C useful in future programming 
tasks. H~ 



Anthony Skjellum graduated from Caltech 
with a B.S. in physics in 1984. He is now 
pursuing graduate studies in chemical 
engineering, exploring the use of parallel 
computers and distributed processing for 
chemical engineering applications. 



double f(x) 
double x; 
{ 




Listing 7. 



/* black box form for data */ 
/* point to evaluate at */ 



double y; 



extern double xarray[ ],yarray[ ]; /* our data defined 

as external */ 
extern int npoints; /* points in arrays */ 

y = linterp(xarray,yarray,x, npoints) ; 
/* compute answer */ 



return(y) ; 



/* return answer (no error check) */ 



double g(y) 
double y; 

{ 



} 



double x; 



/* inverse black box form for data */ 
/* point to evaluate at */ 



extern double xarray[ ], yarrayf ] ; /* our data defined 

as external */ 
extern int npoints; /■* points in arrays */ 

x = linterp(yarray, xarray,y, npoints) ; 
/* compute answer */ 



return(x) ; 



/* return answer (no error check) */ 



Listing 8. 

40 COMPUTER tANGUAGEB FEBRUARY 1985 




When the going gets tough, Optimizing C86 
comes through time and time again, C86 is a 
highly dependable C compiler that has been op- 
timized through the years to provide the best com- 
bination of reliability, speed, and performance, 

FA5T. IN-LINE 8087/60287 SUPPORT 

Now you can take full advantage of 8087/80287 
capabilities, allowing your programs to run many 
times faster than possible with other C compilers 
Plus the source code to all routines is included, 
so you have complete control over all functions. 



• COMPATIBLE WITH WIDELY AVAILABLE 
LIBRARIES such as HALO screen graphics 
and many, many others {call for list). 

• TOPVIEW SUPPORT LIBRARY provides win- 
dowing capabilities. 

• SPEED OPTIMIZATION — there's always room 
to tighten your code, and Computer Innovations 
has the tools to help. For example, 
PROF1LER-86 helps identify key areas for 
optimization. 

TECHNICAL SUPPORT, NOBODY DOES IT 
BETTER 

Computer Innovations has earned a reputation 
for providing customer support that is unequalled 
in the industry. This includes a user's group, an 
on-line bulletin board, and a user's newsletter. 



MORE OF THE FEATURES YOU WANT 

* SOURCE is provided to all libraries for totai 
programming control. The source includes a set 
of standard UNIX routines plus many DOS 
specific functions. 

• SPECIAL IBM-PC LIBRARY including com- 
munication, screen, and keyboard handling 
functions. 

m COMPUTER 

M INNOVATIONS, INC. 

980 Shrewsbury Avenue Tinton Falls, NJ 07724 

E 19Q4 Computer Innovations, \nc. 



JOIN THE THOUSANDS OF PROGRAMMERS 
WHO TRUST AND RELY ON C86 

For Further Information Call 800-922-0169. 

Technical Assistance Call (201) 542-5920. 
Computer Innovations features a full line of 
C products including C-to-dBase (dBase develop- 
ment tool) and Introducing C (C Interpreter 
Language Learning System). Call or write for a 
product profile. 

For Further Information Call 

800-922-0169 

Technical Assistance Call (201) 542-5920 



CIRCLE 8 ON READER SERVICE CARD 



An Open Letter 
to 
@ Users 



Hi. I'm Leor Zolman. author of the BDS C Compiler and president of BD Software, inc. I would like 
to lake this opportunity to personally thank all of you out there who have purchased and used BDS C 
over the past five years for your overwhelming support, feedback, and especially your kind 
words about the package to potential new users. As you may have noticed. I've been doing a lot of 
advertising lately; while the advertising tells the world that BD Software, Inc. is still alive and 
selling C compilers, nothing has served to popularize the package as much as word of mouth, and lor 
that I am grateful. 

While I'm on the subject of expressing appreciation, someone who really deserves a bunch of it is 
Robert Ward, coordinator of the C User's Group. In the three-plus years that Robert has been in 
charge of the Group, he has done a remarkable job of newsletter production and public domain 
software acquisition. If any of you who use BDS C are not already enrolled as members of the C 
User's Group, then you are missing out on some really xpeetmcmisr sofware available for 
peanuts. Here are some of the offerings: a package that effectively makes BDS C put out assembly 
language, screen editors, text formatters, a bulletin board system, cross-assemblers. Unix-style 
libraries (if you don't like the standard CP/M-specific BDS C library), and lots more. Robert, you 
done good. 

BDS C first went on sale in August of 1979. For the first several years of its existence, all copies 
were vended through one particular exclusive distributor in New York. Unfortunately, most dealers 
and many users had trouble dealing with that distributor (to put it mildly), and many dealers 
probably wrote off BDS C due to the difficulty inherent in obtaining it. Late in 1982 1 decided to 
market BDS C myself, and therefore began to interact directly with a number of software dealers and 
distributors. A number of those dealers and distributors have been a special pleasure to work with, 
and I would like to list them here so that any authors out there considering the choice of 
distributors might benefit from my experience: New Generative SyeteaeH. The Pregraaaier'B 
Shop, Weetice. Werfcaaa aai Associates. In japan: Li f cheat lac. (not to be confused with 
Lifeboat New Yorkl) In Australia: AICOM Pacific. 

Thanks again to BDS C users, distributors and Robert Ward for a fun-filled, productive five year 
adventure. If the next five years prove to be even half as gratifying as the last, I'm going to be one 
lucky programmer... 



wBn Wm©u 



*9 

P.O. Box 2368 

Cambridge, Ma. 02238 

(61 7) 576-3828 



42 COMPUTER IANGUAGEB FEBRUARY 1985 CIRCLE 3 ON READER SERVICE CARD 



Parti — Parsing command line arguments 

Programming 
Macros 



in 




.art I of this art- 
icle will cover 
macros as build- 
ing blocks for 
parsing command line arguments in C 
programs. Next month we'll explore how 
macros can also be used as effective tools 
when debugging large programs. Finally, 
in Part III of this special series, we'll look 
at how to use macros in C to translate a 
common representation of data into dif- 
ferent but related tables required by dif- 
ferent programs. 

Most programs take some arguments 
from the command line. It is desirable to 
have a standard way of parsing those 
arguments to insure uniformity of the user 
interface and reduce programming effort 
spent on this common task. 

By careful selection of macros, argu- 
ment parsing can be specified in a very 
compact manner that resembles data dec- 
larations rather than executable code. 
Most error conditions are handled in the 
code generated by macro calls. The same 
degree of compactness cannot be achieved 
by using only functions without macros. 

The parsing algorithm can be custom- 
ized by setting values of several key vari- 
ables. To reduce the volume of informa- 
tion the programmer has to specify, 
default values are provided whenever pos- 
sible. The programmer can override each 
default. A separate macro sets each key 
variable. Each macro has at most one 
argument and the name of the macro is 
mnemonically related to the effect it 
produces. 





By Alexander B. Abacus 



Command line arguments 

Command line arguments are divided into 
positional arguments and key-letter argu- 
ments (also called options). Key-letter 
arguments start with a trigger character, 
which is usually a minus sign. The order 
of processing positional and key-letter 
arguments can be varied: 

■ Deferred processing of positional argu- 
ments. When all key-letter arguments are 
processed before any of the positional 
arguments, all key-letter arguments apply 
to all positional arguments regardless of 
the placement of key-letter arguments. 

■ Immediate processing of positional 
arguments. When all arguments are pro- 
cessed in order, a key-letter argument is 
effective only for the positional arguments 
that follow after it on the command line. 

■ Key-letter arguments must precede all 
positional arguments— required by many 
programs written in C. After detecting the 
first positional argument, these programs 
assume that all subsequent arguments are 
positional. This approach is popular 
because it is easy to implement. It is sup- 
ported by the implementation described 
here but is not recommended. 

Key-letter arguments are further 
divided into flag and text arguments. A 
flag argument consists of a key letter fol- 
lowing a trigger character. Several flag 
key letters can be grouped together fol- 
lowing one trigger character as in: 

-ab 
-a -b 

A text argument consists of a single 
key letter immediately following a trigger 
character and followed by a character 



string either immediately or after a white 
space, as: 

-t Word 

-t "Quoted word" 
-tTail 

Handling of text arguments in C pro- 
grams is inconsistent. Some require white 
space after the flag letter, others do not 
allow it, while most programs accept both 
variations. 

The input to the C program is the com- 
mand line already parsed into words. A 
word is a sequence of characters between 
white spaces. White spaces can be part of 
a word only if the word is enclosed in 
quotes. 

It is obvious that words passed to the C 
program do not correspond to our key- 
tetter arguments. In the first example 
under flag arguments, there are two flag 
arguments but only one word is passed to 
the C program. In the first two examples 
under text arguments, there is one text 
argument but two words are passed to the 
C program. 

Solutions 

The following macro definitions provide 
tools for parsing positional and flag argu- 
ments. Text arguments, additional error 
checking, and some bells and whistles 
will be added in the complete solution. 
The macros defined in Listing I are 
used as a "sandwich." Macros 
ArgBEGINO , ArgLOOP, and ArgEND 
should be thought of as bread in the sand- 



43 




wich. The meat between ArgBEGINQ and 
ArgLOOP are the macros overriding pro- 
vided defaults. Macros between 
ArgLOOP and ArgEND define key-letter 
arguments. 

The complete solution is in the file 
ARGPAR.H. which is far too long to be 
printed alongside this article ( 1 pages in 
length). If you would like a copy of this 
listing, call the COMPUTER LANGUAGE 
Bulletin Board Service (415 957-9370) or 
pick it up on our CompuServe account by 
typing "GO CLM" If you have no access 
to a modem, send a stamped, self- 
addressed envelope to the editor and he'll 
mail you a copy. I strongly encourage you 
to take this extra step if you're truly inter- 
ested in further pursuing this subject. 

The following macros were selected 
from the file ARGPAR.H to illustrate the 
more important and often fundamental 
ideas on how to effectively use macros in 
parsing command arguments in C. 

ArgBEGlN(ArgumentCounter, Argu- 
mentVector) 

Macro ArgBEGINQ starts the sandwich 
that defines argument parsing. Arguments 
of this macro are typically the names of 
the arguments of the function mainQ . 

ArgTrigger(TriggerCharacter) 

Any character can be specified as trigger 
character. Default is ' — '. 

ArgMin(LowLimit) 

specifies the minimum number of posi- 
tional arguments that must be coded on 
the command line. If the macro is not 
coded, the check is not performed. 

ArgMax(HighLimit) 

specifies the maximum number of posi- 
tional arguments that may be coded on the 
command line. If this macro is not coded, 
the check is not performed. 



ArgDescription(String Array) 

The argument StringArray supplies the 
description of command arguments. It is 
printed when requested by the - .'option 
or after any error message that terminates 
the parsing of arguments. 

ArgPosCall( Function) 

This macro turns on the immediate pro- 
cessing of positional arguments. The sup- 
plied function is called when a positional 
argument is recognized. At that moment 
only those key-letter arguments that pre- 
cede that positional argument have been 
processed. (See section on function inter- 
face.) 

ArgKeyLeading 

This macro forces the requirement that all 
key-letter arguments must preceed all 
positional arguments. 

ArgLOOP 

Macro ArgLOOP divides the 
ArgBEGINQ —ArgEND sandwich in two 
parts. The first part is optional and may be 
empty. If present it sets the modes that 
apply to argument parsing. All modes 
have default values provided by 
ArgBEGINQ . Each default can be over- 
ridden separately by coding a macro 
between ArgBEGINQ and ArgLOOP. 
Those macros have already been 
described. 

The second part defines key-letter argu- 
ments. Macros defining key-letter argu- 
ments must be coded between macros 
ArgLOOP and ArgEND . One (and only 
one) such macro must be coded for each 
key-letter argument. Macros defining 
key-letter arguments are described next. 

ArgFlagSet(KeyLetter, Counter- 
Variable) 

Character KeyLetter specified in this 
macro can be used as a flag. This macro 
increments the CoitnterVariable each time 
that flag is found in command line 
arguments. CounterVariable should be ini- 
tialized to zero. Note that the flag is 
allowed to occur more than once on the 
command line. 




ArgTextSet(KeyLetter, Pointer- 
Variable) 

Character KeyLetter specified in this 
macro can be used to introduce text argu- 
ment. Po'mlerVariable is set to point to the 
first character of the text string. Pointer- 
Variable should be initialized to NULL 
pointer. Multiple occurrences of the text 
argument specified by this macro are not 
allowed. 

ArgFlagCall(Key Letter, Flag Function) 

Character KeyLetter specified in this 
macro can be used as a flag. This macro 
invokes FlagFunction . (See section on 
function interface.) 

ArgTextCallf Key Letter, TextFunction) 

Character KeyLetter specified in this 
macro can be used to introduce text argu- 
ment. This macro invokes TextFunction . 
(See section on function interface.) 

ArgEND 

Macro ArgEND ends the sandwich that 
defines argument parsing. After the exe- 
cution of the ArgBEGINQ — ArgEND 
sandwich, ArgmnentCounier and Argu- 
mentVector will be updated to reflect only 
positional arguments. 

Function interface 

Functions required as the second argu- 
ment of macros ArgFiagCallQ , 
ArgTextCallQ , and the only argument of 
the macro ArgPosCallf) all have the same 
interface. They should be defined as: 

char * name(keyLetter, textString) 
char keyLetter; 
char * textString; 



Character keyLetter contains the key 
letter for key-letter arguments and ' \ 0' 
for positional arguments. 

Pointer textString points to the text of the 
argument for positional arguments and 
key-letter text arguments and is a NULL 
pointer for key-letter flag arguments. 



44 



COMPUTER tANGUAGE ■ FEBRUARY 1985 



Simplified argument parsing, positional and flag 

#define ArgBEGIN(A_argc, A_argv) \ 

{ /* Begin block with local variables. Ends with ArgEND. */ \ 
struct \ 
[ int argc, *ptrArgCount ; \ 

char ** argVector; \ 

char * (*ptrFunction) (); \ 

char keyTrigger, *keyPointer; \ 

int arglndex, charlndex, nextPositional, keysTerminated; \ 
} aO; \ 

aO.ptrArgCount = &(A_argc); aO. argVector = (A_argv); \ 
aO.argc = *a0.ptrArgCount; aO. keyTrigger = '-'; \ 
aO.ptrFunction = argPos; 

#define ArgPosCall(A_Function) aO.ptrFunction = (A_Function) ; 
#define ArgTrigger(A__Trigger) aO. keyTrigger = (A_Trigger) ; 

#define ArgLOOP \ 

aO. keysTerminated = 0; aO. nextPositional = 1; \ 

for ( (aO. arglndex = 1); (aO. arglndex < aO.argc); (++a0. arglndex) ) \ 

{ /* for all arguments */ \ 

if ( ( aO. argVector[aO. arglndex] [0] != aO. keyTrigger ) \ 
( aO. keysTerminated != ) \ 

( a0.argVector[a0.ar g Index][l] == '\0' ) ) \ 

/* not a key: bubble up positional arguments */ \ 
aO. argVector [aO. nextPositional] = a0.argVector[aO. arglndex] ; \ 
(void) (*a0.ptrFunction) ( '\0', aO. argVector [aO. nextPositional] ); \ 
++a0. nextPositional; \ 

} \- ' 

else /* it is a key */ \ 

{ \ 
for \ 

( (aO. charlndex = 1, aO.keyPointer = & aO. argVector[aO. arglndex] [1 ] ) \ 
; ( ( aO.keyPointer != (char *) ) \ 
&& ( (^aO.keyPointer) != '\0' ) \ 

) \ 
; (++a0. charlndex, ++a0.keyPointer) \ 

) \ 

{ /* for all characters in an argument */ \ 
switch ( a0.keyPointer[0] ) \ 

{ 

#define ArgFlagSet(A_KeyLetter , A_FlagCounter) \ 

case A_KeyLetter: ++A_FlagCounter ; break; 

Listing 1. (Continued on following page) . 

45 



#define ArgFlagCall(A_KeyLetter, A_Function) \ 

case A_KeyLetter: (A_Function)( *a0.keyPointer , ); break; 

#define ArgEND \ 

default: \ 

(void) fprintf \ 

( stderr \ 

,." Stop. Key letter \'%c\' rejected. \n" \ 

, *a0.keyPointer \ 

); \ 

exit (1); \ 
} /* switch */ \ 
) /* for all characters in argument */ \ 
] /* if key or not a key */ \ 
} /* for all arguments */ \ 

(* aO.ptrArgCount) = aO.nextPositional - 1; \ 
} /* End block begun with ArgBEGIN. */ \ 

static char * argPos( a_keyChar, a_argString ) 
char a_keyChar, *a_argString; 
{ return ( (char *) ); } 



/* 

#if defined DriverH 

finclude <stdio.h> 

void main(argCount, argVector) 
int argCount; 
char * argVector[]; 

[ 

int f_flag = 0; 

ArgBEGIN (argCount, argVector) 

ArgPosCall (argPos) 

ArgTrigger ('-') 

ArgLOOP 

ArgFlagSet (*£', f_flag) 

ArgFlagCall ('F', argPos) 

ArgEND 

exit (0); 
} /* main */ 

#endif DriverH 



Listing 1. (Continued from preceding page). 
46 COMPUTERLANGUAGEBFEBRUARY198J 




The returned pointer should be NULL 
unless an error has been detected. 

Predefined flags 

The following key-letters are predefined 
as flags: 

— ? causes output of argument descrip- 
tion. (See macro ArgDescriptionQ .) 

-! enables all debugging code if the 
program is compiled with debugging 
code. This flag must be the first argument 
after the command name. Besides acting 
as a flag, it can also be immediately fol- 
lowed by text, without a separating white 
space. Text is used to enable selected parts 
of debugging code. 

The flag initializes the global variables 
used by the debugging macros, to be 
described in Part II. 

A trigger character followed by 

another trigger character signals the end 
of key-letter arguments. Remaining argu- 
ments are treated as positional even if they 
start with a trigger character. 

— If the trigger character stands alone 
it is passed as a positional argument. This 
is frequently used as notation for standard 
input. 

The test driver at the end of the include 
file shows how to code the sandwich of 
macros that have been described. Counter 
variables referenced as arguments of 
macro ArgFIagSelQ should be initialized 
to zero. Pointer variables referenced as 
arguments of macro ArgTextSetQ should 
be initialized to a NULL pointer. 

This is just the tip of the iceberg on how 
macros can be used to improve C program 
development efficiency. Next month we'll 
focus on how to use macros in order to set 
up a systematic method for debugging 
your code before you're ready to 
compile. gf 

Reference 

Harbison, Samua! P. and Steele, Guy L. C: A 
Reference Manna!. Prentice-Hall. 1984, 
pp.26-84. 

Alexander Abacus has a B.S. in electrical 
engineering and is a software consultant 
for CCA Computer Inc. , Cranford, N.J. 
His software experience includes work for 
Sperry, IBM, and AT&T Bell Laboratories. 




Debugging Bugging You? 

Torpedo program crashes and debugging delays with 
debugging dynamite for the IBM PC ... « 



UP PERISCOPE! 

First, you install the hardware. 

The hardware's a special memory board 
that fits in a PC expansion slot. Its 16K of 
write-protected memory contains 
Periscope's resident symbolic debugger. No 
runaway program, however berserk it may 
be, can touch this memory! 

Then you UP PERISCOPE. 

Use Periscope's push-button break- 
out switch to interrupt a running 
program ... even when the system's 
hung! Periscope supports Assembly, 
BASIC, C and Pascal. In addition to the 
usual debugging capabilities, some of 
Periscope's features are: 

Stop your system in 
its tracks at any time. 

Use symbol names instead 
of addresses. 

Run a program on one monitor and 
debug on another. 

Monitor your program's execution 

with Periscope's comprehensive 

breakpoints. 

Debug memory-resident programs. 

Put your time to better use. 

The Periscope system is $295. It carries a 30-day money-back 
guarantee and includes the memory board, remote break-out 
switch, debugger software, 100-page manual, and quick- 
reference card. The memory board is warranted for one year. A 
demonstration disk is $5.00. 

System requirements for Periscope are an IBM PC, XT, AT or 
Compaq, PC-DOS, 64K RAM, 1 disk drive and an 80-column 
monitor. For MasterCard and Visa orders only, call 800/421- 
5300 (ext. R%) 24 hours a day. For additional information, call 
404/256-3860 from 9 AM to 5 PM Eastern Time. 

Get your programs up and running; 

up PERISGl^E! 

Data Base Decisions / 14 Bonnie Lane /Atlanta, GA 30328 
CIRCLE 30 ON READER SERVICE CARD 



47 



POWER TOOLS 




You are a serious programmer. Your income depends on developing 
software solutions for complex problems. Fast. Error free. You need 
powerful tools for your compiler. That's what we sell. 



PLINK ™ 86 

OVERLAY LINKAGE EDITOR 



overlays for modules are automatically loaded during ex- 
ecution 

generates symbol tables for PFIX 86 PLUS 
accepts unlimited number of files 

capacity for over 35,000 symbol, commonblock and vari- 
able names 



change overlay structure without recompiling 

sorted memory map reports 

user defined width/height for reports 

define symbols as absolute addresses or offsets from other 

symbols 

overlay is user configurable 

List: S395 



PFIX ™ 86 PLUS 

DYNAMIC SYMBOLIC DEBUGGER 



debugs PLINK 86 overlays 

view source code while debugging 

set temporary or permanent breakpoints 

advanced tracing and trapping capability 

in-line assembler for temporary patches 



preserves program screen and supports dual CRT con- 
figurations 

multiple windows to view code, data, breakpoints, regis- 
ter/stack contents, simultaneously 
supports 8087 numeric coprocessor 
List: S395 



PMATE ™ 

TEXT EDITOR PROCESSOR 



automatic disk buffering 

10 auxiliary buffers that can be edited 

garbage stack 

user customization 

120 command macro language 

store macros permanently 



arithmetic and logical operations 

100 numeric variables 

automatic formatting with indent and word wrap 

insert, overwrite and command modes 

horizontal/vertical scrolling 

List: $225 



[PC] 



We Sell Power 



Phoenix Computer Products Corporation 

1416 Providence Hwy., Suite 220 

Norwood, MA 02062 

800-344-7200 (Mass.) 617-762-5030 

Visa • Mastercard • American Express 



48 



COMPUTER LANGUAGE ■ FEBRUARY 1985 



CIRCLE 82 ON READER SERVICE CARD 




to Assembly 
Interface 




T 



|he fundamental 
question that 
arises when con- 
fronted wilh a 
new general purpose programming lan- 
guage is '"why use it?", which really 
means "what advantages docs it have over 
other languages?" 

Of course, the answer depends upon the 
type of programming tasks to be carried 
out and their complexity or magnitude. 
For complex programming tasks, any 
advantages will have considerable bearing 
on both the effort required to accomplish 
the task and the quality of the resultant 
program. 

It is necessary to access architcclurc- 
dependent machine capabilities to effi- 
ciently accomplish most complex pro- 
gramming tasks. Even without 
considering efficiency this is readily 
apparent for systems software. Since it is 
the nature of any non-machine language to 
be independent of these architecturally 
dependent features, a mechanism is nec- 
essary to access these features. The rela- 
tive ease and efficiency of reaching these 
features is a consideration in choosing a 
language. 

In this article we will briefly look at the 
advantages of C over other compiled pro- 
gramming languages and then focus on 
how C can be easily interfaced to access 
architecture-dependent capabilities. In 
particular, we will show how Lattice C 
can be efficiently interfaced to IBM 
MACRO Assembler to access the IBM PC 



By Brian H. Burger 

ROM interrupt system by providing 
source code to perform video I/O. The 
code provided can be extended to access 
other architecture-dependent features on 
the IBM PC or on any computer using an 
8088/86 architecture. 

High-level vs. assembler 

But if one must access these architecture- 
dependent features in any case, why not 
write the entire program in the assembler 
language of the target computer? After 
all, assembler code should result in the 
most efficient object code. 

The problem is that assembler code is 
Ihc most time-consuming to write and 
understand after it is written and will 
result in a large amount of source code to 
monitor and maintain. In addition, the 
program will only work on the target 
computer (or processor) for which it is 
designed. 

It is generally far superior to write pro- 
grams in a high-level language for 
increased productivity and portability. 
Thus, the better high-level language is the 
one that is most productive and most por- 
table since that is the reason for using it in 
the first place. 

Yet the resultant program must still use 
computer resources efficiently. There is 
no advantage to using a language that pro- 
duces a program too slow or too memory 
hungry, even if it can be generated quickly 
and will work on lots of machines— 
except perhaps when that program is 
used, not as the end result, but as part of 
the process of development. 

A superior language generates a more 
resource-efficient program. In fact, dur- 
ing the early development of FORTRAN 
the efficiency of the program resulting 



from the language was considered to be of 
much greater importance than the design 
of the language itself. John Backus wrote 
in The History of Programming 
Languages : ' 

To this day I believe that our emphasis 
on object program efficiency rather than 
on language design was basically correct. 
I believe that had we failed to produce effi- 
cient programs, the widespread use of lan- 
guages like FORTRAN would have been 
seriously delayed. In fact, I believe that we 
are in a similar, but unrecognized, situ- 
ation today (1978): in spite of all the fuss 
that has been made over myriad language 
details, current conventional languages 
are still very weak programming aids, and 
far more powerful languages would be in 
use today if anyone had found a way to 
make them run with adequate efficiency. 

Separately compiled subprograms 

A high-level language is used instead of 
assembler when the benefits of increased 
productivity and portablity outweigh the 
penalty of less efficient use of computer 
resources. So the best high-level language 
to use is the one which is most productive, 
most portable, and generates the most 
efficient object code. 

Another feature of a superior language 
is its case of use and, by implication, pro- 
grammer productivity. A language is eas- 
ier to use if one can separately compile 
any number of subprograms and link them 
together later to produce an executable 
program. A language that allows sepa- 
rately compiled subprograms is superior 



49 



T ENDS 



DSPIO 



PROC 


NEAR 


POP 


SI 


POP 


AX 


POP 


BX 


POP 


CX 


POP 


DX 


POP 


DI 


INT 


10H 


CMP 


SP.BP 


JA 


DONE 



SAVE RETURN ADDRESS 
GET PARAMETERS 



; OPTIONAL POINTER TO 4 WORD AREA 

; BP IS ALWAYS >= OFFSET OF LAST ARGUMENT 
; IF NO RETURN POINTER PASTITLE DSPIO - 
; SUBROUTINE TO PERFORM DIRECT SCREEN I/O 

int ax, bx, ex, dx ; 
char retval [8] ; 

dspio( ax, bx, ex, dx, retval ) ; 
dspio( ax ) ; 
dspio( ax, bx ) ; 
dspio( ax, bx, ex ) ; 
dspio( ax, bx, ex, dx ) ; 

ax - dx VALUES TO BE PLACED IN THE REGISTERS OF THE SAME NAME 
AS NEEDED BY PARTICULAR VIDEO I/O FUNCTION 

retval, IF SUPPLIED IS A POINTER TO A 4 WORD AREA INTO WHICH THE 
4 REGISTERS AX - DX ARE COPIED AFTER RETURN FROM INT 10H. 

DGROUP GROUP DATA 

DATA SEGMENT WORD PUBLIC 'DATA* 

ASSUME DS: DGROUP 
DATA ENDS 

PGROUP GROUP PROG 

PROG SEGMENT BYTE PUBLIC 'PROG' 

ASSUME CS: PGROUP 

PUBLIC DSPIO 



RLAYOUT STRUC 
RAX DW ? 
RBX DW ? 
RCX DW ? 
RDX DW ? 
RLAYOUT ENDS 



Return address space layout; pointed at by retval 






DSPIO PROC NEAR 

POP SI ; 

POP AX ; 

POP BX 

POP CX 

POP DI ; 

INT 10H 

CMP SP,BP ; 

JA DONE ; 

MOV [DI].RAX,AX 

MOV [DI].RBX,BX 



SAVE RETURN ADDRESS 
GET PARAMETERS 



OPTIONAL POINTER TO 4 WORD AREA 

BP IS ALWAYS >= OFFSET OF LAST ARGUMENT 

IF NO RETURN POINTER PASSED, DON'T SAVE VALUES 



Listing 1 (Continued on a following page). 
50 COMPUTER LANGUAGE ■ FEBRUARY 1985 




lo one that docs not. It wastes computer 
time to recompile an entire program 
whenever a change is made, and it wastes 
programmer time to have to wait for a 
compilation before proceeding. 

Without the capability for separate 
compilation of subprograms, it is 
extremely difficult to maintain a library of 
useful subprograms, next to impossible 
for more than one programmer to work on 
the program, and difficult— if not 
impossible— to access architecture- 
dependent capabilities. Certainly, useful 
programming techniques like information 
hiding, stubbing, modular design and 
development, and others are compatible 
with separate compilation of subprograms 
and are at least inconsistent with the idea 
of one monolithic program compiled as 
one unit. 



The language that produces the most effi- 
cient object code, is most portable, allows 
for the separate compilation of sub- 
programs, and is most productive to use is 
the best language. C is recognized as pro- 
ducing efficient object code because it 
deals with the same sort of objects that 
most computers do. Constructs like 
register-type variables, painters, the 
increment/decrement operators (+ + , 

, + = , * = , etc.), bitwise logical 

operators ( < < . > > , &, etc.). a macro 
capability, and others all lead to efficient 
use of machine resources. 

C is considered to be a very portable 
language. ; It allows and in fact encour- 
ages separately compiled subprograms. 
Part of its portability power and efficiency 
is a consequence of not providing lan- 
guage constructs to do architecture- 
dependent machine operations but instead 
to encou rage the creation of standard 
libraries to accomplish these tasks. 

The brevity and elegance of its expres- 
sive power leads to increased productiv- 
ity. Note that I say "leads to." C requires 
an understanding of the elements of the 
computer and related concepts to a greater 
extent than many other high-level pro- 
gramming languages. The average 




COBOL programmer has little use for 
knowledge concerning the difficulties 
encountered when a data structure falls on 
an odd or even byte address boundary 
since COBOL assumes the programmer 
isn't concerned with these situations and 
consequentially accepts any resultant 
inefficiencies. 

Since C doesn't provide any language 
constructs to accomplish architecture- 
dependent machine functions, it is partic- 
ularly important that one can interface C 
efficiently to assembler to accomplish 
these tasks. Even though C compilers nor- 
mally include a standard library of sub- 
programs, some machine-dependent fea- 
tures are not always included. It is not 
practical to expect a language or compiler 
system to provide access to all or even 
most of these features since they arc spe- 
cific to a particular computer or architec- 
ture and frequently specific even to a par- 
ticular configuration. 

Architecture-dependent capability 

But what is meant by accessing 
architecture-dependent machine capabili- 
ties? For example, machines frequently 
provide in ROM a set of routines for per- 
forming machine specific operations. On 
the IBM PC and other machines utilizing 
the Intel 8088/86 processors, these rou- 
tines can be accessed in assembly lan- 
guage through the software initiated inter- 
rupt system. 

An interface to an assembly language 
subprogram is therefore needed to access 
them from a high-level language. In 
another example, machines generally 
have multiple processors that work inde- 
pendently of the main processor from 
which they get instructions. In 8088/86 
assembly, an instruction can be sent to one 
of these processors by using an assembly- 
level instruction named OOTdesigned for 
this purpose. 

The basic problem then becomes inter- 
facing from a high-level language to the 
assembly level to access these special fea- 
tures in an efficient and uncomplicated 
manner. The rest of this article is devoted 
to doing just that by illustrating the ease 
with which C can be interfaced to assem- 
bly to access the IBM PC video interrupt 
routines. 

You may be wondering why we aren't 
interfacing to perform DOS calls instead. 



in particular the DOS version 2 extended 
screen and keyboard device driver. While 
doing this will likely make the program 
more portable for DOS machines, this 
DOS driver is slow and cumbersome. In 
any case, similar techniques can be used 
to interface to DOS interrupts. 

Interfacing C 

Specifically, Lattice/Microsoft C 
(referred to from this point forward as just 
C) is interfaced to IBM MACRO Assem- 
bler (MASM) to perform video I/O as 
shown in the MASM source code in List- 
ing 1 and the C source code in Listing 2. 3,4 
Figure 1 shows the C memory model that 
is being used. Its limitations are that the 
program can't be larger than I28K— the 
program segment is limited to 64K, and 
the combined data and stack segment is 
limited to 64K, 

This discussion will not be concerned 
with C programs that use an extended 
memory model. If a program needs an 
instruction segment or data segment that 
exceeds 64K bytes, unavoidable ineffi- 
ciencies creep into the implementation. 
There are many other ways to address this 
need rather than extending the memory 
model of the compiler. A discussion of 
this subject is beyond the scope of the 
present article. Furthermore, this model 
is insufficient in few cases. 

Upon entry into a subprogram from C, 
the BP is the only general purpose register 
that needs lo remain unmodified or be 
saved. C loads the BP with a pointer to the 
top of the stack before any arguments are 
pushed and uses that value to deallocate 
the stack upon return from the sub- 
program. This feature allows a variable 
number of arguments to be passed to the 
called subprogram, as the caller can deal- 
locate the arguments from the stack by 
simply restoring the BP to the SP after the 
call. This mechanism requires a two-byte 
instruction (MOVSP.BP) to restore the 
stack after the call instead of the three- or 
four-byte instruction required to explic- 
itly add a value to the stack pointer. 

Since it is the caller's responsibility to 
deallocate arguments from the stack, 
there is no need to know at compile time 
the number of arguments to be passed. AH 
other registers can be freely used except 
for the segment registers which must 
remain unchanged from their original 



51 



C Is The Language. 
Lifeboat Is The Source. 



Lifeboat.™ 
The Leading Source And Authority For Serious Software. 

1-800-847-7078. 



In NY State: 212-860-0300 



Serums Software For The C Programmer From Lifeboat.™ 

Lattice" C Compiler: The serious software developer's first choice. 

Selected for use by IBM,'^ Texas Instruments, Wang," MicroPro," Ashton-Tate," 
IUS/Sorcim," Microsoft" and Lotus" to name a few of the many. Why? 
Lattice C is clearly the finest 16 bit C compiler available today. 

— Renowned for speed and code quality. 

— Fully compatible with the C standards set forth by Kernighan and Ritchie. 

— Four memory model options offer you unsurpassed control and versatility. 

— Superior quality documentation. 

— Now includes automatic sensing and use of the 8087 chip. 

— Widest selection of supporting add-on packages. 

Halo": A graphics development package rapidly emerging as the industry standard. 

— Over 150 graphics commands including line, arc, box, circle and ellipse primitives. 
— New: multiple typefaces which may be scaled and rotated. 
— Supports multiple viewports and is device independent. 

C Food Smorgasbord'": This beautifully written collection of C functions is a valuable time saver. 
— Library includes a binary coded decimal arithmetic package, level I/O functions, 

a terminal independence package, IBM PC ROM BIOS access functions and much more. 

Pmate": The premier editor for the programming professional. 

Pmate is a full screen editor with its own powerful macro command language: 
— Perform on screen row and column arithmetic, alphabetize lists, 

translate code from one language to another, call up other macros. 
— Customize Pmate almost any way you like. 

— Contains 10 auxiliary buffers for storage of macros, text, subroutines. 
— An "undo" feature allows the programmer to retrieve whole series of deleted items. 

Additional C Tools Panel™: Screen formatter and data entry aid. 

Available From Lifeboat: Lattice Windows™: Windowing utility; create "Virtual Screens." 

Plink-86 ,M : The popular linker; includes extensive overlay capabilities. 

Pfix86' M : Dynamic debugging utility. 

Pfix86 Plus'": Symbolic debugger with capacity to debug overlays. 

Btrieve": Database record access/retrieval library. 

Phact: Multikeyed ISAM C-Function library. 

Fabs: Fast access B-tree database function library. 

Autosort: Fast sort/merge utility. 

ES/P: 'C program entry with automatic syntax checking and formatting. 

Greenleaf Functions'": Library of over 200 popular C functions. 
And much more. 

YES! Please rush me the latest FREE Lifeboats catalog ofC products. 

' Company Business 

. Name Phone 



Name Title 

A ddress 



City State Zip_ 



Please check the category where Lifeboat can best help you: 
U Software development \ 3 Corporate Q Education 
D Dealer! distributor Q Government □ Other 



IMP Fli "[-w.ri, n 



Call Direct: 1-800-847-7078 (In NY Stale: 212-860-0300) 

Return coupon to: Lifeboat Associates™ 

1651 Third Avenue, New York, NY 10128. 

CIRCLE 64 ON READER SERVICE CARD 






MOV 


[DI].RCX,CX 




MOV 


[DI].RDX,DX 




JMP 


SI 


DONE: 


PUSH 


DI 




PUSH 


DX ; 




PUSH 


CX ; 




PUSH 
JMP SI 


BX 






DSPIO 


ENDP 




PROG 


ENDS 

END 





RESTORE STACK BECAUSE OF THE POSSIBILITY THAT THEY 
WERE NOT PASSED AS ARGUMENTS 



Listing 1 (Continued from a preceding pane). 



"41 



main( ) 

{ 
int retvals 
int index ; 

SET_MODE ; 

hline(0, 0,219,80) ; 

hline(24, 0,219, 80) ; 

verline(0, 0,219,24) 

verline(0,79,219,24) 

window(3,3,6, 5) ; 

window(10, 10,5,6) ; 

window(7,17,10,ll) 

window(15,40,10,6) 

window(5,50,20,16) 

/* r ead c#define PAGE 
/* video modes */ 
# define s40x25_bw 
fdefine s40x25_color 1 
#define s80x25_bw 2 
#define s80x25_color 3 
#define med_color 4 
#define med_bw 5 
#define high_bw 6 

/* video functions */ 
#define set_type 256 
^define set_cur 512 
#define read_position 768 
#define read_light_pen_position 1024 
#define select_page 1280 
#define scroll_up 1536 
#define scroll_dn 1792 
#define read_attribute__char 2048 
#define write__attribute_char 2304 
#define write_char 2560 
#define set_palette 2816 
#define write_dot 3072 
#define read_dot 3328 
#define write__teletype 3584 
#define get_state 3840 



/* draw box around screen */ 

/* i.e., manual window using nonwindow characters */ 



h 



macros 



7 



#define curpos(row,col) dspio(set___cur ,PAGE,0, (((int)row)<<8)+col) 

Listing 2 (Continued on a following page). 
54 COMPUTER LANGUAGE ■ FEBRUARY1985 




entry values. This mechanism is efficient 
and flexible— only one register needs to 
be saved upon call of a subprogram or 
remain unmodified, and it can be passed a 
varying number of arguments. 

C passes arguments to its subprograms 
by value, not by reference. So any argu- 
ment passed is a copy of the original 
value, not a reference or pointer to it. 
Arguments are passed by pushing them 
onto the stack in reverse order. That is, 
the first argument pushed is the rightmost 
argument appearing in the C function call. 
Upon entry to the subprogram, the first 
parameter appears on the top of the stack 
after the return instruction pointer pushed 
by the call. 

The routine 

The subprogram in Listing 1 is straight- 
forward. To understand the particulars of 
the video I/O functions sec the IBM Per- 
sonal Computer Technical Reference Man- 
ual. The macros in the source code in 
Listing 2 provide enough information to 
use most of the functions without the man- 
ual, and the source code preamble in List- 
ing 3 provides most of the additional par- 
ticulars needed. 

The video I/O interrupt lakes its argu- 
ments from the four general purpo.se reg- 
isters AX through DX and returns values 
in those same registers. This subprogram 
takes five arguments corresponding to the 
four general purpose registers to be 
passed to the video I/O interrupt routine 
and a pointer argument used for storage of 
any return values. The return address is 
popped into SI, the arguments are popped 
off the stack directly into the four general 
purpose registers, and the fifth argument 
is popped into the DI register for later 
use. The second through fifth arguments 
are valid only if the subprogram was actu- 
ally called with those arguments. 

After the video I/O interrupt is exe- 
cuted, the subprogram determines if a 
pointer was actually passed a.s (he fifth 
argument by recognizing that the BP is 
equal to the SP before any arguments 
were pushed. If it is a valid argument, the 
values of the four general purpose regis- 
ters are copied to the locations pointed at 
by the fifth argument. 

Similarly, all but the first argument are 
returned to the stack in case they were not 
actually passed. For those functions that 



return values in the general registers in 
addition to AX, all five arguments must 
be supplied. Otherwise incorrect values 
would get on the stack, and return values 
would be placed somewhere other than 
where they were supposed to go. 

Only those arguments actually needed 
must be passed if no values are returned, 
plus any intervening arguments. When 
dspio is called to perform the set mode 
function in Listing 2, only one value is 
passed. Since the video I/O interrupt 
doesn't care what is in any of the registers 
it doesn't use when called, there is no 
need to pass trailing filler arguments. 

However, if the re are some intervening 
arguments, as when changing the cursor 
position in curpos , the intervening argu- 
ments must be included. To avoid the 
passing of filler arguments, the function 
code passed in the first argument can be 
used to branch to code that pops the argu- 
ments only into registers pertinent to the 
function. Thus, for function code 2 (i.e., 
set mode), it can be assumed that there 
will be no argument supplied for CX and 
the third argument can be popped into DX 
instead. 

This is what dispio in Listing 3 is all 



C memory model 



about. Dispio avoids passing arguments 
unncccessarily, thereby increasing exe- 
cution speed but for the penalty of 
increased instruction overhead. 

An alternative 

In Listing 3 a jump table is used to effi- 
ciently control the execution of code. It 
works by storing offsets in a table in such 
a way so that the function code stored in 
the first argument can be used as an index 
into the table to obtain the appropriate 
address to jump to. Thus, the order in 
which labels are stored into CASEJTABLE 
determines the code that will be executed 
upon receiving a function code in the high 
byte of the first argument. The first argu- 
ment is copied into BX . the Tunction code 
is extracted, multiplied by 2 (since 
addresses are words), and used as an 
index into CASEJTABLE to obtain the 
address to which the subprogram trans- 
fers control . 

C treats subprograms a.s functions that 
return values. They return their function 
value to the caller in the general registers. 
The registers pertinent are determined by 
the type of the function. Thus, for/«r 



At most 64K segment 
of data and stack 



At most 64K segment 
of instructions 







\ 


Grows 

downward 

7 


A 


Grows 

upward 




L 


J 


A 




Grows 




upward 







Stack segment 



Data segment 



Control segment 



Figure 1. 



55 



#define SET_MODE dspio(s80x25_bw) 

#define horline(ch, width) dspio(write_char+ch, PAGE, width) 

#define hline(row, col, ch, width) curpos(row,col) ; horline(ch, width) 

#define wrtchar(ch) dspio(write__char+ch,PAGE, 1) 

main( ) 

{ 
int retvals [4] ; 

int index ; 
SET_M0DE ; 

hline(0, 0,219, 80) ; /* draw box around screen */ 

hline(24, 0,219,80) ; /-* i.e., manual window using nonwindow characters */ 
verline(0,0,219,24) ; 
verline(0,79,219,24) ; 
window(3,3,6, 5) ; 
window(10, 10,5,6) ; 
window(7, 17,10, 11) 
window(15,40,10,6) 
window(5,50,20,16) 

/* read cursor position */ 
for (index=0; index <4; index++ ) { 

curpos(index,index+l) ; 

dspio(read_jposition, PAGE, 0,0, retvals) ; 

printf("For page PAGE, Row:%u, Col:%u, cursor mode=%o,%o \n", 

retvals[3]»8, (retvals[3]«8)»8, retvals[2]»8, (retvals[2]«8)»8) 

) 

/* get current video state * I 
dspio(get_state, PAGE, 0,0, retvals) ; 
printf ("Mode: %u, Columns: %u, Active Page: %u \n", 

(retvals[0]«8)»8, retvals[0]»8, retvals[l]»8 ) ; 

} 

window(row,col, width, depth) /* start at row, col, i.e. left upper corner */ 

char row, col ; 

{ 

/* first do 4 corners *l 

curpos(row,col) ; 
wrtchar(214) ; 
curpos(row+depth,col) ; 
wrtchar(211) ; 
curpos(row,col+width-l) ; 
wrtchar(183) ; 

curpos(row+depth,col+width-l) ; 
wrtchar(189) ; 

/* then connect corners with horizontal and vertical lines */ 
hline(row,col+l,196,width-2) ; 
hline(row+depth,col+l,196,width-2) ; 
verline(row+l,col,186,depth-l) ; 
verline(row+l,col+width-l , 186,depth-l) ; 

} 

verline(row, col, ch, len) 

char row, col, ch, len ; 

( 
char cnt ; 

for (cnt=len; cnt > 0; cnt — ) { 
curpos(row++,col) ; 
wrtchar(ch) ; 

) 
} 

Listing 2 (Continued from a preceding page). 
56 COMPUTERIANGUAGEB FEBRUARY 1985 



functions the return value is stored in the 
AX register upon exit from the sub- 
program. The other registers are used for 
types requiring larger size return values. 

For those video I/O Functions that sup- 
ply values upon return From interrupt in 
AX, no processing is required as they are 
passed back to the C caller as the called 
functions return value. 

Thus, functions read attribute and char- 
acter and read dot return information as 
the value of the int function dispio upon 
return. Get state returns all but the current 
active display page as dispio 's int function 
value in addition to storing it in the return 
area. Get light pen position returns 
whether or not the light pen switch is trig- 
gered as dispio's char function value or as 
its high byte int function value, in addition 
to storing it. 

In fact, all information can be returned 
as the function value of dispio upon return 
provided dispio is typed as double. How- 
ever, C would have to generate code to 
deal with this long float type, which 
would result in unnecessary inefficiencies 
in most cases. 

Efficiency 

An instruction efficiency analysis of the 
minimum and maximum instruction 



sequences for both routines 6 shows that 
dispio is almost always faster. When no 
values are returned, it executes from 16% 
to 30% faster and when values are 
returned, from 24% faster to 5% slower. 

Dispio is actually faster than the anal- 
ysis indicates since it eliminates all excess 
pushing of arguments from C. while dspio 
requires pushing of filler arguments. For 
example, the worst case path for dispio is 
when it is doing a read light pen position 
and takes 198 cycles. Dispio requires two 
arguments from C and thus two pushes, 
while dspio would require five arguments 
from C or five pushes. Adding the extra 
three pushes for dspio yields 2 19 cycles 
compared with 198 cycles for dispio , 

Clearly dispio will always be faster than 
dspio. If one is willing to put up with 
always supplying five arguments to dspio, 
the four pushes to restore the stack can be 
deleted, in which case it will be almost as 
fast as dispio . Of course, since C will be 
pushing arguments that aren't needed, 
that savings is partly an illusion. 

Finally, one could return all values 
through C's function mechanism. The 
type of the function must then be chosen 
carefully, as the type declared will depend 
on what values are to be returned. To 
some, C opens a Pandora's box since C 



requires more knowledge of the machine 
and computer-related concepts than most 
other languages. To others, C allows 
increased productivity resulting from 
using a flexible high-level language with 
an acceptable efficiency penalty. H 

References 

1. Backus, John. "The History of FORTRAN 
I. II. and III." Tile History of Programming 
Languages . Edited by Wexelblat. Richard 
L. Academic Press ( 1 98 1 ): 25-45 . 

2. Harry, David. "An Implementation 
Demonstrating C Portability." Computer 
Language (Oct. 1984): 21-29. 

3. Microsoft /Lattice C Compiler. Lattice/ 
Lifeboat (1982). Microsoft (1983). 

4 . IBM Personal Computer MACRO Assem- 
bler. IBM (1981 1. 

5 . IBM Personal Computer Technical Refer- 
ence Manual . (Aug. 1981): A-43 through 
A-45. 

6. Rector, Russell, and Alexy, George. Tile 
8086 Book. OSBORNE/McGraw-Hili 
(1980). 



TITLE DISPIO - SUBROUTINE TO PERFORM DIRECT SCREEN I/O 

#define MAX 8 

char retvals [MAX] /* used by 3 functions */ 

/* (1) - read cursor position; retvals[0-l] = current cursor mode */ 

/* retvals[3] =- col, retvals[2] = row */ 

/* (2) - read light pen position */ 

/* retvals[0] = active(l)/inactive(0) */ 

/* retvals[2-3] = pixel column, retvals[4]=raster line */ 

/-* retvals[6] = row, retvals[7] = col *•/ 

/* (3) - get state; retvals[0] = cols, retvals[l] = mode */ 

/* retvals[2] = page */ 

setmode - dispio(mode) ; 

set cursor type - dispio(set_curs_type, type) ; 

set cursor position - dispio(set_cursor,page«8,row<<8+col) ; 

read cursor position - dispio(read_cursor_position,page<<8, retvals) ; 

read light pen position - dispio(read_j)en, retvals) ; 

select active page - dispio(select_j»age+new_page_value) ; 

scroll active page up - dispio(scroll_up+number_of_lines, page<<8, 

lrow<<8+lcol, rrow<<8+rcol) ; 
scroll active page down - dispio(scroll_down+number_of__lines, page<<8, 

lrow<<8+lcol,rrow<<8+rcol) ; 
get attribute character at current cursor pos - dispio(readac,page<<8) ; 

returns attribute character as function value -high byte attribute, 

low byte character 
write attribute character at current cursor position - dispio(writeac+char , 
page<<8+attribute, repeat count) 

Listing 3 (Continued on following page). 



57 



; write character - dispio(write_char+character , page<<8, repeat count) 

; set color palette - dispio(set_pallette,pallette<<8+color_value) ; 

; write dot - dispio(write_dot+color , col, row) ; 

; read dot - dispio(read_dot,col,row) 

; dot read returned as low byte of function value 

; write teletype - dispio(write_teletype+char , (page<<8)+color) ; 

; get state - dispio(get_state, retval) 

DGROUP GROUP DATA 

DATA SEGMENT WORD PUBLIC 'DATA' 

ASSUME DS: DGROUP 
CASEJTABLE DW SETMODE , CURSTYPE , SETCURS , READCURS , READPEN , SETMODE 

DW SCROLL , SCROLL , READAC , WRITEAC , WRITEAC , RE ADAC , WRITEDOT 

DW WRITEDOT, READAC, STATE 
; case table uses 16 words 

RLAYOUT STRUC ; Return address space layout 
RAX DW ? 
RBX DW ? 
RCX DW ? 
RDX DW ? 
RLAYOUT ENDS 
DATA ENDS 

PGROUP GROUP PROG 

PROG SEGMENT BYTE PUBLIC 'PROG 1 

ASSUME CS: PGROUP 

PUBLIC DISPIO 



Listing 3 (Conri)iued on following page). 



QUALITY SOFTWARE AT 
REASONABLE PRICES 

CP/M Software by 

Poor Person Software 
Poor Person's Spooler $49.95 

All the funclion of a hardware print buffer at a fraction of the 
cost. Keyboard control. Spools and prints simultaneously. 

Poor Person's Spread Sheet $29.95 

Flexible screen formats and BASIC-like language. Prepro- 
grammed applications include Real Estate Evaluation. 

Poor Person's Spelling Checker $29.95 

Simple and fast! 33.000 word dictionary. Checks any CP/M text 
file. 

aMAZEing Game $29.95 

Arcade action for CP/M! Evade goblins and collect treasure. 

Crossword Game $39.95 

Teach spelling and build vocabulary. Fun and challenging. 

Mailing Label Printer $29.95 

Select and print labels in many formats. 

Window System $29.95 

Application control of independent virtual screens. 
All products require 56k CP/M 2.2 and are available on B* IBM and 5" 
Northstar iormaK, other S" formats add S5 handling charge. California 
residents include sales tax. 

Poor Person Software 

3721 Starr King Circle 

Palo Alto. CA 94306 

tel 415-493-3735 

CP/M ts a registered trademark of Digital ftesearcri 



i 








CIRCLE 51 ON READER SERVICE CARD 

58 eOMPUTERlANGUAGEBFEBRUARY1°85 



The Tools 

You Need 

T<TC You Thru. 

Now the TC/tyvuCT&artt," 

Applications Programmers Toolkit 

provides everything you need 

to increase your C programming productivity. 

AFT" features: 

• File Handlers • String Math 

• Direct Access • Screen Generator 

• Keyed Access • Report Generator 

• Generic Terminal Driver • FIFO Que Routines 

• String Handling • Source Code 

• Manual On Disk (45 pages) 

• Tutorial On Disk (33 pages) 

• Detailed Brochure on request 
UNDC " System 3T Version (available m-ss) . $995 

MS-DOS " Version $495 

BDS C Version $395 

Manual Only* $50 

•Manual Coat will be applied, to APT* purchase price within 
30 day* (*t'Q restocking charge). U.S. fundn only, ploaao. 
TrftdimvLt mmn: UNIX " (AT&T Bell L*b-J. MS-DOS"- (MJCT»eft. lac). BDS C" (BD Sortwm). 
Wlunlwu-B - aJjil APT* (Sh*W'. Anurlcvi T*chnotaglM} 

Call: (800) 443-0100 Ext. 282 

Ask for AFT" or Send Check To: 

Shaw w American Technologies 

TOijiVtd'WtVU." 

^^ 830 South Second Street • Box 648 

Louisville, KY 40201, U.S.A. 

(C.O.D. and fiirripi Orders AdrJ ¥:> Bhippni^ H m idling J 

IMrmm* B*nk Of 1#ui»vtI* CHlu-ni Fidelity B»nk 1.iiili.viI1i- Chunhrr at {VirTiriirn-r 

«£OQ(«r. ' ' i TV "■^11T« '" n l^r-?JfcjiSkj»j«£^aj«f ,- 

CIRCLE 92 ON READER SERVICE CARD 



\ 



i 



DISPIO PROC 
POP 
POP 
MOV 
XOR 
CMP 
JA 
SHL 
JMP 

ERROR: MOV 

JMP 

SETCURS: POP 
POP 

SETMODE: INT 
JMP 



READCURS : 



SCROLL : 
WRITEDOT: 



READAC : 



POP 
INT 
POP 
MOV 
MOV 
JMP 

POP 
POP 
POP 
INT 
JMP 

POP 
INT 
JMP 



NEAR 

SI 

AX 

BL,AH 

BH.BH 

BL.15 ; 

ERROR 

BX,1 

CASE_TABLE[BX] 

AX.-l 

SI 

BX 
DX 

10H 
SI 

BX 

10H 

DI 

[DI].RAX,CX 

[DI].RBX,DX 

SI 

BX 

cx 

DX 

10H 

SI 

BX 

10H 

SI 



INVALID FUNCTION CODE ? 



WRITEAC: POP 


BX 


CURSTYPE: POP 


CX 


INT 


10H 


JMP 


SI 


STATE: INT 


10H 


POP 


DI 


MOV 


[DI].RAX,AX 


MOV 


[DI].RBX,BX 


JMP 


SI 


READPEN: INT 


10H 


POP 


DI 


MOV 


[D1].RAX,AX 


MOV 


[DIj.RBX.BX 


MOV 


[DI].RCX,CX 


MOV 


[DI].RDX,DX 


JMP 


SI 


DISPIO ENDP 




PROG ENDS 




END 






Software 
Development 

PCDOS/MSDOS 

Complete C Compiler 

• Full C per K&R 

• Inline 8087 or Assembler Floating 
Point, Auto Select of 8087 

• Full 1Mb Addressing for Code or 
Data 

• Transcendental Functions 

• ROMable Code 

■ Register Variables 

• Supports Inline Assembler Code 

MSDOS 1.1/2.0 
Library Support 

• All functions from K&R 

• All DOS 2.0 Functions 

• Auto Select of 1 .1 or 2.0 

• Program Chaining Using Exec 

• Environment Available to Main 



c-window™ 

Symbolic Debugger 

• Source Code Display 

• Variable Display & Alteration 
Using C Expressions 

• Automatic Commands 

• Multiple Breakpoints by Function 
& Line Number 

8088/8086 Assembler 

• FAST — Up to 4 times Faster than 
IBM Assembler 

• Standard Intel Mnemonics 

• Compatible with MSDOS Linker 

• Supports Full Memory Model 



8088 Software Development 
Package 



$ 



199 



00 



Includes: C Compiler/Library, 
c-window, and Assembler, plus 
Source Code fore-systems Print 
Utility 

c-systems 

P.O. Box 3253 

Fullerton.CA 92634 

714-637-5362 



Listing 3 {Continued from preceding page). 



CIRCLE 16 ON READER SERVICE CARD 



59 



In 



Add EDITING 

to your 

Software 

with 

CSE Run-Time 

Your program can include all or a portion 
of the C Screen Editor (CSE). 
CSE includes all of the basics of full 
screen editing plus source in C for only 
$75. For only $100 more get CSE Run- 
Time to cover the first 50 copies that you 
distribute. 

Use capabilities like Full cursor control, 
block move, insert, search/replace or 
others. Portability is high for OSes, ter- 
minals, and source code. 
Call for the "CSE Technical Description" 
and for licensing terms and restrictions. 
Versions for PCDOS. MSDOS. CPM, more. 
Full Refund if /— ► ■ ■ « 

not satisfied in -^DOlUtlOfi 

first 30 days. „_D UStefTIS 

Call 800-821-2492 ns-l Washington Street 
CIRCLE 93 ON Nonuell, MA 02061 

READER SERVICE CARD 617-659-1571 



THE PHOGKAMMEUS SHOP 



helps compare evaluate and find products. Get answers. 



pSERViCE: FREE LITERATURE 

One free call covers all programmer's software. Ask for a 
"Packet" on: "AT, BASIC. C. COBOL, Debuggers. Edi- 
tors. FORTH. FORTRAN, Libraries. PASCAL. UNIX/PC Or 
30 "addons" for "C". 



Recent Discovery 



Inlrnducing-C : C Interpreter and training system. 
Nice. Thorough. PCDOS. Only S95. 



'C" Language 



MSDDS:CB6- 8087. reliable 

Lattice 2.1 - improved - 30 addons 

Microsoft C2.x 

Williams ■ debugger 

instant C interpreter, fast, lull, debug 
CPM80: Ecosoft C-now solid, lull, faster 
MAC: Megamax - fast, full, light 



flunson 

PCDOS 

8086 

8086 



lam 

BRIEF -Intuitive, flexible 
PMATE • powerful 

VEDIT- full, liked 



ARTIFICIAL INTELLIGENCE 



IO LISP- full 100QK RAM PCDOS 

TLC LISP -with "classes", nice MSDOS 
MicraProlog - by Logic Prog. Assem. MSDOS 
PROLOG-86 - standard. Learn fast MSOOS 
EXSYS - Expert System PCDOS 



OUR 
PRICE 
call 
call 
329 
call 
500 
225 
295 



195 
195 
119 



call 
250 
285 
125 
295 



FORTRAN 



MS Fortran • Improved 
DH Fonran-86 - full "77" 

F77L - by Leahy -Nice. 
RM Fortran 



SUPPORT PRODUCTS 



Runson 

MSDOS 

8086 

MSDOS 

MSOOS 



LIBRARIES: BTRIEVE ISAM MSDOS 

Clndex+ - ISAM, source, no royalt. 8086 

CSHARP Realtime - source, full MSDOS 

CUtil by Essential MSDOS 

DATABURST - Screens-C. BAS MSDOS 

Graphic - 4200 x 3100, source MSDOS 

Greenleal C - thorough MSDOS 

HALO Graphics ■ last, full PCDOS 

TOOLS: MULTIUNK - multitask PCDOS 

Polylibrarian-thorough MSDOS 

PolyMAKE-manage, compiles PCDOS 

Profiler-86-easy to setup, symdois MSDOS 

XENIX- "true S3", rich. + C-MSDOS PC 



OUR 
PRICE 

249 
259 
449 
545 



215 
375 
600 

139 

195 
165 
175 
65 

89 

89 

125 

1285 



PERISCOPE DEBUGGER - 
"Reset Box", own RAM. 
Registers, symbols, 
ine nums. 2 screen, 
PCDOS. S295. 



Call for a catalog and solid value 

800-421-8006 

THE PROGRAMMER'S SHOP™ 



Note: All prices subject to 
change without notice. 

Mention this ad. Some prices 
are specials. 

All formats available 
Ask about PCs. COD. 



CIRCLE 98 ON READER SERVICE CARD 



c 

Helper 

DIFF and CMP - for "irrtetitgent" file comparisons. 
XREF- cross references variables by function and line. 
C Flow Chart - shows what functions call each other. 
C Beautif ier- make source more regular and readable. 
GREP - search for sophisticated patterns in text. 
There are several other utilities that help with converting 
from one C compiler to another and with printing 
programs. 

C Helper is written in portable C and includes both full 
source code and executable files 
for $1 35 lor MS-DOS, CPM-80 
or CPM-86. Use VISA, 
Master Card or COD. 

Call: 800-821-2492 



Solution 
.Systems 



335-1 Washington Street 
Norwell. MA 02Q61 
617-659-1571 
CIRCLE 99 ON READER SERVICE CARD 



PROLOG-86 

Become Familiar in One Evening 

The tutorials combined with the interactive PROLOG-86 
Interpreter help you learn the fundamentals of PROLOG 
quickly. In a few days you should be able to modify sophisti- 
cated sample programs included with the product like: 

• an EXPERT SYSTEM 

• a NATURAL LANGUAGE INTERFACE. 

1 or 2 pages of LOGIC and FACTS create a significant 
PROLOG program that might take 1 to 1 5 pages in C. 

Prototype quickly in PROLOG. Experiment with applications 
that might otherwise require a "definitive requirements 
specification". 

Programming experience is not required to use PROLOG- 
86, but alogical mind is. 

PROLOG-86 supports the de facto standard established by 
"Programming in PROLOG". Ask aboutthe "Artificial Intelli- 
gence Concepts" CONTEST. $1 ,000 prize. 
FULL REFUND if not satisfied during first 3 weeks. 

Intro Price: $125 for PCDOS, MSDOS or CP/M-86. Most for- 
mats available. 



For questions/orders, call 

800-821-2492 
UseVisa,MC,COD. 
CIRCLE 97 ON READER SERVICE CARD 



-Solution 

^Systems 

335- l Washington St 
Norwell, Mass. 02061 
617659.157] 



60 COMPUTER LANGUAGE ■ FEBRUARY19S5 



EXOTIC LANGUAGE 
OF THE MONTH CLUB 



I 



magine an inter- 
active program- 
ming language 
where all data is simply a siring of charac- 
ters. There are no integers vs. real num- 
bers concerns. For instance, the length of 
the string "BLUE", the number 3. 14, and 
the integer 432 1 are all 4. 

Conversion from numeric to string 
never takes place: numbers are already 
strings! You can use numbers and 
alphanumeric strings in any arithmetic 
operation. Of course 2 * 3.14 is 6.28. but 
"2APPLES" + "30RANGES" = 5. 
(Who said you can't mix apples and 
oranges!) The rule is that a string used as 
a number is converted to the number until 
a nonnumeric value is encountered. 

Furthermore, even array subscripts are 
considered character strings. Thus an 
array such as X(J) with a value of 23 is 
typical, but how about ACODEfNYC ") 
having the value of 212? Of course alpha- 
betic and numeric values can co-exist in 
(he same array. 

Sounds a lot like SNOBOL, but this is 
actually a quick start in looking at 
MUMPS, a unique language that has been 
around since the early 1970s. It has many 
rather unusual but very powerful data 
management features. To those accus- 
tomed to FORTRAN. COBOL, or BASIC 
and the like, MUMPS appears quite odd, 
plus hard to use and understand. How- 
ever, this doesn't have to be the case. 

It is really quite easy to work with 
MUMPS. In particular, it has enabled the 
design of many complex multi-user sys- 
tems in which interactive users all share in 
the access to and update of data bases. 
Before we consider this level of MUMPS, 
let's look more closely at some of the lan- 
guage's more basic features. 

Since all data is represented as a string, 
there arc many string related functions, as 
in BASIC. For example, to retrieve some 
portion of a string you use the EXTRACT 
function. Thus 

SEXTRACT("Computers",l,J) 

returns the /lh through Jlh characters 
from the first argument to the function. If 



MUMPS: A multi-user, data base language 

By J. Edward Volkstorf Jr. 



/ is 4 and J is 7 then the function value is 
"pute". 

Note that functions arc distinguished by 
a leading dollar sign (otherwise we would 
have designated a three dimensional 
array). Variables may be up to eight 
alphanumeric characters that begin with a 
letter. Other string related functions 
include: 

■ $LENGTH(X) returns the number of 
characters, i.e., the length of variable X 

■ $CHARACTER("A ") equal to 65, 
returning the ASCII code for a character 

■ $FIND("COMPUTE", "MP") has the 
value 3, finding the first occurrence of the 
string "MP" in the first argument 
COMPUTE 

■ $PIECEC1ST,2ND,3RD"","N) returns 
the Nth comma delimited portion of the 
first string argument, such that if N is 2 
then 2ND is returned. The second argu- 
ment, the comma here, determines the 
delimiter 

Of course functions can be nested, and 
numeric values can be used as arguments. 
For example, 

■ $FIND(N, ". "J will be either if N is an 
integer (i.e., no decimal point) or some 
value greater than if it is a real number 

■ $LENCTH($PIECE(NAME, ","1)) 
might be used to calculate the length of 
someone's first name, those characters 
preceding the first comma in the string 
NAME 

As mentioned initially, arrays may also 
contain strings. They may be any dimen- 
sion, and subscripts may be ASCII char- 
acter strings. A typical array might be 
used, as in most languages, to store a table 
of numbers: 

X(1) = 12,X{2) = 23,X(3) = 34,etc. 

but since MUMPS allows those subscripts 
to be character strings you can design data 
tables that look like: 

ACODE("SAN DIEGO") = 619 
ACODE("LOSANGELES") = 213 
ACODE("SACRAMENTO") = 916 

where the array ACODE defines the valid 
telephone area code numbers for a set of 
cities. For data such as a person's name, 
street address, arbitrary words, and the 



like, this allows some incredible savings 
in program code when manipulating data. 
But how do you retrieve the values? 

In the first example the array A' could 
use a subscript variable that ranges from I 
to 3. MUMPS handles the area code array 
differently, using the SNEXT, BORDER, 
and SDEFINE functions. 

Both $NEXT and SORDER take a sub- 
scripted variable and determine the sub- 
script value that follows in that array 
based on the MUMPS collating system. 
(Note that this gets tricky, since for 
numeric subscripts 123 follows 45 which 
follows 6, but for a strict string collating 
sequence, left to right character com- 
parisons are made: the sequence would be 
123, 45, then 6). MUMPS determines 
whether subscripts are collated as numer- 
ics or as ASCII character strings . 

Thus for ACODE, the following holds: 

■ $NEXT(A CODE( ' X OS ANGELES ' 'J ; 
would be "SAN DIEGO" 

■ SNEXT(ACODE("SA ")) would be 
"SACRAMENTO" 

■ SNEXT(ACODE("SAN DIEGO")) is 

- 1 , indicating that no further subscripted 
values were found. 

The last example is where $NEXT and 
SORDER differ. The latter returns a null 
string instead of the — 1 . 

There is another way to determine if a 
single value exists using the SDATA func- 
tion. It takes any variable name as an 
argument and returns 1 if the variable is 
defined , a 10 if it is a pointer to a lower 
level (such as the first subscript in a two 
dimensional array), or 1 1 . which covers 
both cases. Otherwise a zero is returned. 
Thus, 

■ SDEFINE(ACODE("S4N DIEGO")) 
returns 1 

■ $DEFINE(ACODE("SANTA CLARA")) 
returns 

■ $DEFINE(ACODE) returns 10 

■ but $DEF1NE(AREAC("L0S ANGE- 
LES ")) returns since AREAC is not the 
correct array name (assuming it is not 
used). 



A 



ong with this set 
of string func- 
tions is a host of 



numeric and string operators. Many are 



61 



very powerful in nature. For numerics, 
the typical arithmetic operators of + , — , 
*, / are used for addition, subtraction, 
multiplication and division. Also an 
integer divide is symbolized by \ and 
modulo operator by #. The last two oper- 
ators make for very concise expressions 
such as 

123 \ 10= 12 
123#10 = 3 
123 \ 10 # 10 = 2 



For string operations, the underline 
designates concatenation. The right 
bracket is the contains operator which 
tests whether the first argument contains 
the second. The left bracket signifies a 
string follows comparison. As you might 
expect, the usual Boolean operators, =, 
< , > , < = , and > = , are used for 
assorted equality and inequality checks. 

Keeping track of operator precedence is 
simple in MUMPS; there isn't any. Oper- 
ators arc processed in a strict left to right 
sequence except for expressions in paren- 
theses which, as expected, are processed 
first. 

One of the more powerful Boolean 
operators is the ?, which tests for pattern 



GOOD NEWS! 




HIT W. Virginia si. 
Milwaukee. H7 .ViL'OI 
(414) 276-2937 



c 

for the 

6809 

MAS NEVER 

BETTER! 

INTROL-C/6809,Version1.5 

Introl's highly acclaimed 6809 C 
compilers and cross-compilers are now 
more powerful than ever! 

We've incorporated a totally new 6809 
Relocating Assembler. Linker and Loader. 
Initializer support has been added, leaving 
only bitfield-type structure members and 
doubles lacking from a 100% full K&R 
implementation. The Runtime Library has 
been expanded and the Library Manager is 
even more versatile and convenient to use. 
Best of all, compiled code is just as 
compact and fast-executing as ever - and 
even a bit more so! A compatible macro 
assembler, as well as source for the full 
Runtime Library, are available as extra-cost 
options. 

Resident compilers are available under 
Uniilex, Flex and OSS. 
Cross-compilers are available for PDP- 
11/UNIX and IBM PC/PC DOS hosts. 

Trademarks: 

!ntrol-C. Introl Corporation 

Flex and Uniflex. Technical Systems Consultants 

OS9, Microware Systems 

PDP-11. Digital Equipment Corp. 

UNIX, Bell Laboratories 

IBM PC. International Business Machines 

For further information, please call or write. 



matching. A 1 or truth value is returned 
depending on whether or not the first 
argument follows the pattern designated 
by the second argument. Patterns are 
determined by various character class 
codes and string constants, which can be 
modified by a numeric repeat count. For 
example, in the following statement the 
letter N designates numeric digits that test 
whether the variable SSN is a valid social 
security number: 

IFSSN?3N1"-"2N1"-"4N 

Thus the pattern is three digits, a dash, 
two more digits, a dash and ending with 
four digits. 

In the following example, the letter V 
indicates upper case alphabetic characters 
and A , an alphabetic character. The 
period is used to mean any number of 
characters as a repeat count. The 
expression 

IFNAME?1U.A1", "1U.A 

might be used to check for a person's 
name, formatted as a last name and first 
name separated by a comma . 

Other letter codes include C for control 
characters. E for any character (every- 
thing), and P for punctuation. 

Logical expressions are combined with 
& for and and .' for or. The apostrophe 
may be used in front of any logical oper- 
ator for the inverse of the operator. Thus 
IFX<0 !(X>1) tests whether X is less 
than zero or if it is greater than one, and 
IFM'I"." & (M?.N) tests whether M is 
all digits and does not have a decimal 
point. 

Another powerful operator is @. which 
represents indirect reference of "indi- 
rection." Indirection is a unary operation 
that is performed on character strings. 
The result of an indirection operation 
depends on how it is used. Basically, @ 
takes a value and treats it like a variable: 

SET NAM = "X" ; variable NAM gets 
value "X" 

SET ©NAM = 2 ; indirectly sets vari- 
able X to value 2 

or an expression: 

SET ARG = "X = 3,Y = 4"; define an 

argument 
SET @ARG ; sets X to 3 and Y to 4 

Indirection is useful in processing differ- 
ently named arrays with one statement. 



A 



sin BASIC, 

input and output 
in MUMPS is 
oriented around interactive video display 
and printer terminals. The command 



CIRCLE 32 ON READER SERVICE CARD 
62 COMPUTER LANGUAGES FEBRUARY 19B5 



WRITE outputs the values for constants, 
variables, and expressions to the currently 
assigned I/O device. 

Input is done in a similar manner using 
the READ command. For example, the 
code in Listing 1 reads a set of integer val- 
ues and prints their sum. Note the pattern 
matching command and the entry of a null 
string "" to indicate no more data. Com- 
ments arc denoted in MUMPS as all text 
that follows a semicolon on a single line. 

MUMPS program lines begin with one 
or more spaces or with an alphanumeric 
line label. Statements are separated by a 
single blank space. Since the syntax of 
each statement determines its format and 
overall length, statement delimiters are 
not needed. Control may be passed to 
named lines with the GOTO or DO 
commands. 

The S£7"command assigns values to 
any number of variables. Note that the IF 
command does not use a THEN. MUMPS 
continues processing with the command 
that follows the logical expression if it is 
true. Otherwise control is transferred to 
the beginning of the next line. 

An ELSE command is available but not 
in the sense of most other languages . 
Instead MUMPS has an internal last truth 
value that may be checked at anytime with 
the ELSE. 

Thus an IF might have a corresponding 
ELSE located many lines of code away. 



The IF can test this internal truth value by 
using a null expression, designated by two 
blank spaces after the IF. This means the 
results of an IF evaluation can be checked 
in other areas of a program without the 
original expression being coded. 

Loops in MUMPS are coded using the 
FOR command. FOR repeatedly sets a 
variable to some value based on one of the 
four following basic formats: 

FORI = l:l:10;setsltol,2,3... 10 

FORN = "TOM","DICK","HARRY"; 

sets N to each of the strings that 

follow 
FOR 1 = 1:1 UNTIL I >99; increments I 

until the condition following the 

UNTIL is true 



FOR 1 = 1:1 WHILE I < 100; 

increments as long as the condi- 
tion after the WHILE is true 

The scope of the FOR is only to the end 
of the line. Thus the following counts how 
many numbers are greater than in the 
100 element array NUM: 

SETGZ = 0FORI = lTO100IF 

NUM(I)>0SETGZ = GZ+1 

The DO command calls subroutines. It 
is like the GOTO in all respects except 
that anywhere in the code to which control 
is transferred, a QUIT statement can be 



SET TOTAL=0,CNT=0 ; initialize total and count variables 

IPN READ "Enter a number: ",NUMB 

IF NUMB="" GOTO DONE ; exit on a null entry 
IF NUMB'?.N WRITE NUMB," is not valid" ; validate number 
ELSE SET TOTAL=TOTAL+NUMB,CNT=CNT+l ; update values 
GOTO IPN ; get next number 

DONE WRITE "Read ",CNT, "numbers for a total of ".TOTAL 
HALT ; end of program 

Listing 1. 



OASYS 

TOOLKIT 
SNAP-SHOT 



WIZARD 

C-8086 

CROSS AND NATIVE OPTIMIZING COMPILERS 
FOR 8086/87/88/186/286 



As part of OASYS' "ONE STOP SHOPPING" service for software engineering tools, we are proud to announce the addition 
of WIZARD C to our integrated collection of more than 50 professional programming tools (e.g. compilers, assemblers, 
linkers, debuggers, simulators & translators) for M68000, Intel 8086/80186 and NS32000 micros. 

WIZARD C benchmarks (against Lattice, Microsoft) prove that it is, by far, the most advanced, full featured, fastest, 
tightest, optimizing C compiler now available for cross and native (PC) development Here's why . . . 



FEATURES 

• Complete K&R implementation plus 
V7, III extensions 

• Supports 8087 Floating Point 

• Built-in LINT 

• Long, medium, short models 

• 190+ UNIX 111 functions — complete 
run-time library 

• In-line assembly allowed 

■ 100+ extensive warnings/diagnostics 

• Intel and Microsoft compatibility at 
source and object levels 

■ Written in C — easily ported 

• Comprehensive bound documentation 

• Supports DOS 2.0, 2.1 , IBM/BIOS 

W86CH-11/84 



SUPPORT TOOLS 

• Symbolic C Source 

Level Debugger (CDEBUG™) 

■ 1 00% Intel compatible structured 
Macro Cross Assembler, 
Linker/Locate rand Librarian 

• 8086 Simulator 

• Floating point math package 
(40+ functions) 

• C Time Profiler (CLUE™) 

• Checkout compiler (SAFE-C") 

• Comm. utilities for up/down 
loading to MDS, TEK, Microtek 



AVAILABILITY 

NATIVE: PC/XT/AT using 

MS/DOS, PC/DOS (Xenix soon) 

CROSS: VAX/VMS, Bsd 4. 1 , 4.2, III, V; 
8086's, 68000's (All Unisoft III, V; 
ports); Cailan, Masscomp, Sun, 
Pyramid, dozens more . . . 

Call for pricing, OEM, Site, Corporate, 
Source and Maintenance licensing 
information. 



OASYS 

60 ABERDEEN AVENUE 

CAMBRIDGE, MA 021 38 

(617)491-4180 



CIRCLE 75 ON READER SERVICE CARD 



63 



executed causing a return to the next 
expression in the calling DO statement. A 
DO may call one or more subroutines 
such as: 

DO SUB1 ,SUB2,SUB3 ; perform in 
succession the 3 subroutines 

Related in some respects to indirection 
is the XECUTE command . It evaluates its 
argument as a command string to be exe- 
cuted as though it were explicitly coded in 
the program. For example. 



XECUTE $PIECE("GOTO NEXT/DO 
PREV",'7",N) 

either does a GOTO NEXT or a DO PREV 
depending on whether N has the value of ) 
or 2. Obviously some very cryptic and 
run-time dependent code can be created 
with this command. 

A noteworthy coding format in 
MUMPS allows conditional execution of 
all commands, with minor exceptions. A 
command name may be followed by a 
colon and some expression. The expres- 
sion is evaluated and. if true, the com- 
mand is processed. Otherwise it is 
bypassed. Thus the FOR loop counting 



example could be coded 

SETGZ = 0FORI = 1TO100 
SET:NUM(I)>0GZ = GZ+1 

A GOTO or DO command also may use 
this conditional execution as in: 

DO:X » "YES" SAVE ; call subroutine 

SAVE if X is YES 
GOTO:!' = SUM ; goto line labeled 

SUMiflisnotO 

The expression can also follow argu- 
ments to the DO and GOTO, which is 
handy for selectively executing certain 
subroutines: 



« 



; 



; 



'• .« 

How Do You 
Measure A Good 
C Compiler? 




CODE SPEED & SIZE 

The Laltice C ComDiler 
"generates code thai is 
quite compact and last 
running!' Peter Norton, 
PC Magazine 

CONSISTENT RELIABILITY 

"The Laltice Compiler has 
performed reliably and 
predictably" ft Phraner, 
Byle Magazine 

COMPILE TIME 

"Lattice is a real performer!' 
Houston. Brodrick, 
Ken!, Byte Magazine 

THIRD-PARTY LIBRARIES 
More than 40 library products 
are currently available 
for Lattice 

UNIX V COMPATIBILITY 

The Lattice Library is 
UNIX Vcompalible 

DEBUGGER SUPPORT 

The Lattice C-SPRITE 
Debugger is now available 

DOCUMENTATION 

Laltice "is thorough 
and excellent! D. Clapp, 
PC Magazine 



UNIX is a trademark of 
AT&T Bell Laboratories 



UPDATE POLICIES 

Lattice provides Iree bugfix 
updates for 90 days 

COOPERATING PRODUCTS 

New LMK Utility, dBC Library, 
CVUE Screen Text Editor, CURSES 
Screen Library and GSS Graphics 
are available Irom Lattice 

VENDOR REPUTATION 

Lattice is used in more 
commercial products than any 
other C Compiler, No run- 
time license is required. 

ALL MEMORY MODELS 

Lattice C has 7 memory models 
available to allow the best 
solution for the task at hand 

AVAILABILITY OF 
CROSS COMPILERS 

SATISFACTION GUARANTEED! 

Ask About Our "Trade Up To Lattice C" Policy 



01 LATTICE 



Lattice', Inc. 
P.O. Box 3072 
GlenEllyn, IL 60138 
(312)858-7950 
TWX 910-291-2190 



DO 

SUB1:X<0,SUB2:X = O,SUB3:X 
>0,SUB4 

which performs one of the subroutines 
SUB1 . SUB2 . or SUB3 depending on the 
value of X and always calls SUB4. 



B 



y now many 
ireaders may 
'think MUMPS is 
a variation of BASIC but without line 
numbers and numeric and string data typ- 
ing. To some extent this is true. Where 
MUMPS truly leaves all other languages 
behind is in its ability to process complex 
data structures that are disk resident. 

MUMPS files do not exist in the tradi- 
tional sense. All disk data is a string of 
ASCII characters, named in the same 
manner as local memory-resident vari- 
ables, with the exception of a A (carat) 
preceding the name. The significance of 
this is that all statements, commands, 
functions, operators, etc may use disk 
variables in a manner identical to local 
variables. 

MUMPS calls its disk data globals 
since disk data may be shared by all users. 
Memory-resident variables, on the other 
hand, are local to one particular MUMPS 
process. Thus instead of opening, read- 
ing, and writing a file, you simply S£7'the 
global to some value. For instance, the 
following statement adds one to a status 
global and then displays its current value: 



SETASTAT = ASTAT+1 WRITE 
is",ASTAT 



Status 



CIRCLE 53 ON READER SERVICE CARD 

64 COMPUTER LANGUAGE" FEBRUARY 19B5 



The SDEEINE function, mentioned ear- 
lier, determines whether a global exists or 
not. Thus a statement like the one below 
might precede the above update of global 
STAT 

IF $DEFINE(*STAT) = WRITE "Status 
not defined" 

These two examples illustrate the sim- 
plest forms for using a global. More often 
globais arc processed as multi- 
dimensional arrays where the subscripts 



are either numeric or string subscripts. 
Processing a global then takes on the form 
of array processing using the FOR loop 
and SNEXT or SORDER functions. 

A strict numeric sequence of integers 
might be used as subscripts to store a 
series of statistical values, where each 
value in the global is a single number. For 
example, let the global A X contain 200 
values. Then their sum is simply: 

SETTOTAL = FOR 1 = 1:1:200 
TOTAL == TOTAL + AX(I) 

which is identical to how the values would 
be totalled if ^X were a local array. 

As with local arrays, global subscripts 
are also defined sparsely, i.e., only those 
values defined are actually stored in the 
global. An accounting system could use a 
global to track the status of purchase 
orders where the subscript is a purchase 
order number. The data stored at a partic- 
ular node in the global might contain 
items such as the date ordered, the cus- 
tomer number, and so on. For further 
detail on the data— the purchase order in 
this example— a second set of subscripts 
might be used for information about the 
nature of the order, the line items in it, 
terms, etc. 



We could have a situation where the 
code presented in Listing 2 would tell a 
user if a purchase order exists and the date 
when it was made based on the first sub- 
script in global ^PONUMB. 

A second level of subscripts might be 
the line item numbers in the PO. with a 
subscript of zero indicating how many 
lines, plus other related information. 
When a PO is confirmed to exist using the 
previous example, the line items might be 
printed, unformatted, as in Listing 3. 

The unformatted data is noted since the 
values in the string would usually be vari- 



able length with some special character 
delimiter. The SPIECE function is then 
used to determine individual field values. 
A line item node in the above global might 
look like: 

1 2 ^ MX! 02 A DS/DD Diskettes A 1 .50 
A 18.00 

which could indicate 12 model MX 102 
DS/DD diskettes at SI .50 each for a total 
of S18.00. The A is an often-used 
MUMPS field delimiter. 



PON READ "Enter PO number: ",P0 

IF P0*?.N WRITE "Invalid number" GOTO PON 
IF $DEFINE( A PONUMB(P0))=0 WRITE "Not on file" 
ELSE WRITE "Ordered: "/PONUMB(PO) 
GOTO PON 

Listing 2. 



SET LN="P0NUMB(P0,0) 

WRITE LN," line items for P0 ",P0 

FOR I=1:1:LN WRITE !,"Line ",1," ", 

Listing 3. 



'P0NUMB(P0,I) 



OASYS 

TOOLKIT 
SNAP-SHOT 



C-68000 

CROSS AND NATIVE OPTIMIZING COMPILERS 

FOR 68000/10 (and 68020 SOON) 



OASYS offers a "ONE STOP SHOPPING" service for software developers in need of proven B-, 16- and 32-bit cross and 
native tools for Unix and non-Unix 68000, 8086 and 32000 systems. Our critically acclaimed and widely used 68000 tool kit 
offers high quality, reliable, cost-effective tools. 

The OASYS 68000 tool kit consists of Green Hills compilers (C, Pascal and FORTRAN), our own M68000 Macro Assembly 
Development package, and dozens of other OASYS compatible support tools. Simply stated, we beat the competition on 
price, speed and tightness of emitted code. 



V 



C-68000/10 

• Full K & R with Western Electric and Berkeley 
extensions 

• Complete run-time library available as 
source. No royalty if passed on. 

• Supports DEC & IEEE Floating Point 

• Integrated optimizer: 30% tighter code than 
Portable C; 4 times faster 

• Generates M.I.T. or EXORmacs assembly 
source code 

• Interfaces to all OASYS tools and Pascal, 
FORTRAN and PL/M-68K compilers 

• Ideal for cross development of boards with no 
OS, a kernel OS (e.g. VRTX, PSOS, MTOS), 
or Unix based 68000's 

C68K-1 1 1SA 



68000/1 Assembly package Other tools 



• EXORmacs compatibile Macro 
Assembler, Linker, Librarian, and 
Cross Reference Utility 

• Generates S-records and a.o. 

• PIC and reentrant code 

• Used 2 years in house 

• Over 3,000 sold to date 

• Runs on VAX, Prime, PDP-11, 
68000's, 8086/88 (PC) 

• Written entirely in C 
Coming soon 

• 68020 C and Cross assembler 



Symbolic C Source Debugger 

68000 Simulator 
& Disassembler 

C Linecount and Time Profiler 
Utility (CLUE TU ) 

LINT for VAX/VMS 

Check Out compiler 
(SAFE-C ,U ) 

Communications tools 



OASYS 

60 ABERDEEN AVENUE 

CAMBRIDGE, MA 02138 

(617)491-4180 



CIRCLE 80 ON READER SERVICE CARD 



65 



NGS FORTH 

A FAST FORTH 
OPTIMIZED FOR THE IBM 
PERSONAL COMPUTER 
AND MSDOS COMPATIBLES. 

♦79 STANDARD 

*FIG LOOKALIKE MODE 

♦PC -DOS COMPATIBLE 

♦ON-LINE CONFIGURABLE 

♦ENVIRONMENT SAVE 
&LOAD 

♦MULTI-SEGMENTED 

♦EXTENDED ADDRESSING 

♦AUTO LOAD SCREEN BOOT 

♦LINE AND SCREEN EDITORS 

♦DECOMPILER & 
DEBUGGING AIDS 

♦8088 ASSEMBLER 

♦BASIC GRAPHICS &, SOUND 

♦NGS ENHANCEMENTS 

♦DETAILED MANUAL 

♦INEXPENSIVE UPGRADES 

♦NGS USER NEWSLETTER 

A COMPLETE FORTH 
DEVELOPMENT SYSTEM. 

PRICE: $70 

PLEASE INCLUDE 12 POSTAGE k 
HANDLING WITH EACH ORDER. 

CALIFORNIA RESIDENTS : 
INCLUDE 6.5% SALES TAX. 



m 



NEXT GENERATION SYSTEMS 

P.O.BOX 2987 

SANTA CLARA, CA. 9 5055 

(408) 241-5909 



MUMPS provides a syntactic con- 
venience in processing giobals. called the 
naked reference, II essentially means that 
a global reference may be made without a 
name and the last level in the global will 
continue to be processed. This means the 
global coded *PONUMB(PO,I) could 
have been coded as simply A (I) since the 
initial reference was in the first line at the 
second level subscripts. 

With two or more subscripts used to 
define their data, giobals take on the form 
of tree structures. Although not a data 
base management system in the fullest 
sense. MUMPS provides all the language 
features needed for creating any hier- 
archical data base. 

Most MUMPS systems implement their 
global data structures using some form of 
balanced B* or multiway tree structure. 
This guarantees a reasonable response 
time to examine any node in any size 
global. 



M 



UMPSisalsoa 
multi-user data 
management 
system. Its global data structures may be 
referenced by any user on the system. For 
instance, the purchase order global could 
be referenced by any number of users on a 
system checking the status of their pur- 
chases. The typical MUMPS system has 
all global references occurring in a buffer 
pool (sometimes called a disk cache) so 
that each user has access to the same and 
most current data. 

Updating a file is another matter. To 
control the sequence in which a global is 
updated there is a LOCK command. This 
allows a user to have exclusive control of 
an entry in a lock table that in turn typi- 
cally defines an area of a global. 

In the purchase order example, a 
receiving area might be changing the sta- 
tus of some line items in the file. In the 
clerical area a buyer might also change 
something in the PO that is on back-order. 
Either user could have their program 
LOCK the entire order if both used a state- 
ment of the form: 

LOCKApoNUMB(PO) 

On the other hand, if the changes are 

only specific to one line item in the order 
then the control may be: 

LOCKApoNUM8(PO,LINE) 

where PO is the purchase number and 
LINE the line number being changed . 

Users on the system making inquiries 
do not have to use the locking code since 
they will always be retrieving the most 
current PO data from the buffer pool. 

In general, access codes, passwords, 
and the like on commercial MUMPS sys- 
tems provide an overall control mech- 
anism. They usually map a group of 
related giobals to a certain user class 



when those users sign on to the system. 
Many variations exist, even to the extent 
of coding certain giobals as read only, or 
read/write by user class. 

The HANG and JOB commands are also 
useful in a multi-user environment. The 
HANG command suspends program exe- 
cution for a specified number of seconds. 
This might be used in time dependent pro- 
cesses, such as waiting until a certain time 
of day has arrived before continuing with 
program execution. 

The JOB command initiates another 
MUMPS process. This might be some- 
thing as simple as a print spooler to a pro- 
cess that files the records generated by a 
number of other data entry processes. 
With the HANG command the second pro- 
cess could be set to function every few 
minutes or so instead of continually 
wailing for records to file. 



A 



t this point I 
would like to 
describe the 



typical MUMPS system layout. A single- 
user system consists of basically the inter- 
preter and the single-user area. The user 
area has a fixed space that describes the 
current context in which the user is func- 
tioning. Three variably sized areas also 
exist: the user's program code, the local 
variables (the symbol table), and a stack 
area for intermediate values during pro- 
gram execution. (Figure 1.) 

For multi-user systems, an executive 
handles the time sharing and context 
switching between users. In the disk 
buffer pool all global references arc han- 
dled. (Figure 2.) 

This area is also used to hold program 
routines called in from the disk by the DO 
and GOTO commands. Some venders 
even share program code between users. 
Thus the user partition only consists of the 
fixed context area, the symbol table, and 
stack. 

Some systems do not fluctuate just in a 
fixed partition area and thus allow the 
symbol area to be completely dynamic in 
size. Some systems even swap partition 
overflows to and from the disk. In these, 
MUMPS becomes a virtual machine much 
in the same manner as the IBM 360/370 
OS. 

Some MUMPS vendors who offer net- 
worked systems provide another very 
sophisticated area of global processing. In 
these systems a global has some additional 
coding within its name designating that it 
resides on another machine. For example, 
some vendors use brackets to indicate the 
networked machine as in 



SET 



A [MACH3]GLOBAL(SUBl,SUB2) 
= 



CIRCLE 74 ON READER SERVICE CARD 

66 COMPUTERLANGUAGEBFEBRUARY19B5 



UniPress 

Product 

UPDATE 



AMSTERDAM COMPILER KIT 
FOR UNIX 



Package of C and Pascal compilers, cross 
compilers and assemblers. The Kit was 
developed at the Vrije University of Amsterdam 
and has been used in Europe for years. 
Available for a wide variety of host and target 
machines: Unix 68000, VAX and PDP-1 1 and can 
produce code for any of those machines, plus 
the 8086. 

Collection of programs designed to simplify the 
task of producing portable compilers and 
interpreters. 

The Kit contains complete internals 
documentation describing how to make 



modifications needed to add a new program 

language or a new target machine. 

Cross assemblers are also provided for 8080, 

Z80, Z8000, 8086, 6800, 6809, 68000, 6502, and 

PDP-1 1. Cross interpreters, for testing, are also 

included. 

The Kit consists of 8 components: preprocessor, 

front end, peephole optimizer, global optimizer, 

back end, target machine optimizer, universal 

assembler, utility package. 

The Kit includes all sources and documentation 

for VAX/Unix 4.1/4.2, PDP- 1 1 /V7, and MC68000 

implementations. 



OEM terms available • Much more Unix software, 
too! • CaJl or write for more information. 



Source 

Price: Full system $9950 

Educational Institution $995 

Source requires an AT&T source compiler UfliPfGSS Sof tlUOfO, IflC. 

license 
Binary 

Full system $4995 
(contact us for specific 
availability) 



2025 Lincoln Highway, Edison, N] 08817 
201-985-8000 • Order Desk: 800-222-0550 (outside NT) 
Telex 709418 • Mastercard and Visa 

Lattice is a registered trademark of Lattice. Inc. Unix is a trademark 
of Bell Laboratories. MS-DOS is a trademark ot Microsoft. 



CIRCLE 38 ON READER SERVICE CARD 



c 

Programming 
Guidelines 



Thomas Ptum 




C LANGUAGE PROGRAMMING 

From Plum Hall. ..the experts in C training 



Learning to Program in C 372 pp., th- x w. Price S25 00 
A practical step-by-step guide for everyone acquainted with com- 
puters who wants to master this powerful "implementer's language" 
Inside, you will learn how to write portable programs for the full 
spectrum of processors, micro, mini and mainframe 



C Programming Guidelines wo pp.. iw x 10-, Price S25.00 
A compilation of standards for consistant style and usage of C 
language. Arranged in manual page format for easy reference, it 
presents time-tested rules for program readability and portability. 



FREE 

C LANGUAGE POCKET GUIDE! 

A handy C language programming 
pocket guide is yours free when you order 
either (or both) of the manuals above 
A full 14 pages of valuable C language 
information! 



PLUM HALL 

1 Spruce Av, Cardiff NJ 08232 
Please send me: 



The experts in C and UNIX™ training. 
Phone orders: 609-927-3770 

information on C and UNIX Training Seminars 
copies of Learning to Program in C @ S25.00taopy 
copies of C Programming Guidelines @ S25.00/copy 



NJ residents add 6% sales to< 



COMPANY. 
ADDRESS _ 



CITYfSWEIZtP 

i Check American Express 

CARD * 

UNIX ii a irooemcfi oi ATM Ben Laoo'oione> 



Master Cord 

EXP. DATE 



Signatute, 



CIRCLE 50 ON READER SERVICE CARD 



67 



WHY WOULD ANY SANE PERSON 

SPEND $199 FOR A BetterBASIC 

SYSTEM WHEN DOS's IS FREE? 

HERE ARE 10 REASONS: TEST YOUR SANITY 

I. Full support for 640K memory 2* Structured language with BASIC syntax 
3* Separately compiled program modules *L Speed: FAST 5* Extensibility (Make 
your own BASIC.) 0« User-defined procedures and functions /• Built-in windows 
support O. Interactive programming language based on an incremental compiler 
9. 8087 math support 10. Runs on IBM PC, IBM PC/XT and compatibles 



Summit Software 

Technology, Inc.™ 

P.O. Box 99, Babson Park 

Wellesley, MA 02157 

(617) 235-0729 



NOW AVAILABLE FOR 
THE TANDY 2000 & 1200 




BASIC 



Sane Programmers Order BetterBASIC Now 

Price: $199 8087 Math Module: $99 
Runtime System: $250 Sample Disk: $10 



BeilerBASIC is o trademark □( Suaimi! Serf two re Technology, (nc 

IBM PC. IBM PC/XT end PC/DOS ate trademarks of Iniernofional 
Business Machines Corp. MS-DOS is a trademark of Microsoft! Corp. 

MasterCard, VISA, RO. Checks, Money Orders, 
ondCO.D. accepted. 



CIRCLE 88 ON READER SERVICE CARD 




$1 30 while quantity lasts. 



work < | ' rvvdrffl V^^ 

ie Intel ceramic ^rW '■'■ * F 

/hich operates at +J^BJr\ 



Put the 
speed and power 
of the 8087 to 
for you. 

We've got the 
8087-3 chip which 
5 MHz. 

Order by phone and we ship the same day 
for Visa or MasterCard customers. Or you can send cash, 
check or M.O. (Sorry, no COD's). Add California state 
tax, if applicable and S3 for shipping in the U.SA or 
Canada; $15 for foreign air mail. (415) 827-4321 

_. _ . . VISA MASTERCARD 

Steve Rank, Inc. 

1260 Monument Blvd., Concord, CA 94518 




CIRCLE 87 ON READER SERVICE CARD 
68 COMPUTER LANGUAGE "FEBRUARY 1985 



CIRCLE 90 ON READER SERVICE CARD 



A MUMPS program that SETs the 
global value is actually passing data 
through a high-speed communications 
device to another MUMPS computer's 
disk. Once again, other than the slight 
name change, the remote global is pro- 
cessed in the same manner as one on the 
current machine, which is the same as 
locally defined variable data. 

As you can sec now. MUMPS is not just 
a language but a unique way of developing 
multi-user data base oriented systems on 
mini, and microcomputers. When 1 think 
of MUMPS I think of the fanaticism of C 
or Forth. Like these languages. MUMPS 
is fostered by a dedicated set of program- 
mers who often work with systems con- 
taining over 100 interactive terminals that 
are updating and accessing the same data 
base on moderately priced 
minicomputers. 

MUMPS has its roots in the health care 
environment; in 1969, the initial version 
of the language was created at Massachu- 
setts General Hospital. The following 
seven years saw a small proliferation of 
various dialects which culminated in an 
ANSI standardized version that was first 
offered by a number of hardware manu- 
facturers, most notably Digital Equip- 
ment Corp. on its PDP-1 1 . 

The language is currently available on a 
wide range of minis, including the Data 
General Eclipses, Prime, Tandem, and 



others, MUMPS is also available in a 
multi-user environment on the IBM PC 
and 6809-based microprocessors. Single- 
user systems are also available for the 
Apple, 6809. IBM PC, and 8080 systems. 

MUMPS has an enormous number of 
applications in the health care field, par- 
ticularly in laboratory and radiology data 
management where there is extensive 
variable length textual data. 

Another important application includes 
overall patient data management for 
admissions, business office and medical 
records. Many clinic and physician group 
practice systems also use MUMPS and of 
course many business-oriented applica- 
tions are written in it. 

The key element MUMPS offers is its 
ease in developing multi-user data man- 
agement systems. In the health care appli- 
cation examples noted, it is essential to 
allow all users access to individual patient 
data. For example, in a laboratory appli- 
cation, test results can be viewed as soon 
as they are entered into the system on 
video display terminals at the nursing sta- 
tion, physicians' lounge, or even the phy- 
sician's office if he or she has a modem 
for dialing into the hospital's computer. 

For further information contact the 
MUMPS Users Group. They offer a wide 
assortment of publications and services 
for the novice and veteran MUMPS user. 
A national meeting takes place every year 
in June in different parts of the country. 
For more specific information on actual 



commercial MUMPS systems, the MUG 
provides a list of current vendors of 
MUMPS language processors and 
MUMPS applications. Four 
microprocessor-based MUMPS system 
vendors arc also included in the 
references, JJ 

References 

1. MUMPS User's Group, 4321 Hartwick 
Rd„ Suite 308. College Park. Md. 20740 

2. Micronetics Design Corp.. 932 Hungerford 
Dr., #\ 1, Rockville, Md. 20850, (301) 
424-4870. Motorola 6809. 68000. IBM PC 
MUMPS implementations. 

3. Richard Walters. Ph.D.. Dept. of Com- 
puter Science. Univ. of California. Davis. 
Calif. 95616. Public domain 8080. 8088. 
Z80 MUMPS. 

4. Innovative Computer Systems Inc., 1660 S. 
Albion, Ste. 902. Denver, Colo. 80222. 
(3031 759-7633. IBM PC implementation. 

5. Eclectic Systems Corp., 16260Midway 
Rd . , Addison . Te xas 7500 1 . (2 1 4) 
661-1370. Various microprocessor imple- 
mentations of MUMPS. 

J. Edward VolkstorfJr. is a free-lance soft- 
ware consultant living in Chesapeake, Va. 



Single user MUMPS system memory layout Multi-user MUMPS system memory organization 



Interpreter 

Fixed area 
Program area 
Stack 
Symbol table 



Time sharing executive 
Interpretor 

Disk cache/buffer pool 

User 

partition 

areas 



Figure 1. 



Figure 2. 



69 



wizard C 

Fast compiles, fast code and great diagnostics 
make Wizard C unbeatable on MSDOS. Discover 
the powers of Wizard C: 

ALL UNIX SYSTEM 111 LANGUAGE FEATURES. 

UP TO A MEGABYTE OF CODE OR DATA. 

SUPPORT FOR 8087 AND 80186. 

FULL LIBRARY SOURCE CODE, OVER 200 FUNCTIONS. 

CROSS-FILE CHECKS OF PARAMETER PASSING. 

USES MSDOS LiNK OR PLINK-86. 

CAN CALL OR BE CALLED BY PASCAL ROUTINES. 

IN-LINE ASSEMBLY LANGUAGE. 

240 PAGE MANUAL WITH INDEX. 

NO LICENSE FEE FOR COMPILED PROGRAMS. 

The new standard for C Compilers on MSDOS! 

Only $450 



WSS 



For more informatior. call (617) 641-2379 

Wizard Systems Software, Inc. 

11 Willow Ct., Arlington. MA 02174 

Visa/Mastercard accepted 



CIRCLE 86 ON READER SERVICE CARD 



• 








MACWTOSHISA 
P£GSTEHH>TPADEMAPJ< 
OF APPLE COWLTTEflNC 



RP/ 




T.M. 



By the author of Hayden's "CP/M Revealed." 

New resident console processor RCP and new 
resident disk operating system RDOS replace CCP 
and BDOS without TPA size change. 

User files common to all users; user number 
visible in system prompt; file first extent size 
and user assignment displayed by DIR; cross-drive 
command file search; paged TYPE display with 
selectable page size. SUBMIT runs on any drive 
with multiple command files conditionally invoked 
by CALL. Automatic disk flaw processing isolates 
unuseable sectors. For high capacity disk systems 
RDOS can provide instantaneous directory access 
and delete redundant nondismountable disk logins. 
RPMPIP utility copies files, optionally prompts 
for confirmation during copy-all, compares files, 
archives large files to multiple floppy disks. 
RPMCEN and GETRPM self-install RP/M on any 
computer currently running CP/M®2.2. Source 
program assembly listings of RCP and RDOS appear 
in the RP/M user's manual, 

RP/M manual with RPMGEN.COM and GETRPM.COM 
plus our RPMP1P.COM and other RP/M utilities on 
8"SSSD$75. Shipping $5 ($10nonUS). MC,VISA. 



m 



118 SW First St. - Box G 
Warrenton, OR. 971U6 

icro • 

ethods, Inc. 

(503) 861-1 765 



CIRCLE 52 ON READER SERVICE CARD 



CIRCLE 13 ON READER SERVICE CARD 
70 COMPUTER LANGUAGE ■ FEBRUARY 1985 



YOU DON'T NEED 

EUREKA! ?? 

CONGRA TULA TIONSU 

Wc admire your talents. After all, few people can 
remember where tn find that six month old letter to Wonder 
Waffle Works, or which of the twenty versions of 
IMPORTNT.BAS istheoneyou need yesterday. 

Or maybe we should envy your spare time. Ah, to be able lo 
haul out a slack of disks, slip each one into a drive, browse 
through the directory, and TY PR the various prospects lo find 
that one file or program. 

Or perhaps you're the adventurous type who thrills to the 
challenge of groping through scantily labeled disks, cheering 
that magical moment when hidden treasures are uncovered. 

On the other hand, it occurs to us that you just may not 
know the advantages of EUREKA!, the fast, menu driven disk 
catalogcr for CP/M. EUREKA! puts your entire disk library 
at your fingertips. Files may be found quickly and easily - by 
name or by comments you can put in the file itself. Of course 
the manual includes a tutorial to help you get started. 

Still only SSO. Ask your dealer, or contact: 

MENclociiMO Sofru/ARE Company, Inc. 



Dcpt. L-l 
P.O. Box 1564 
Willi!!. CA 95490 
Phone: (707M59.9130 

Add S2.W Shipping: 

Cnlil ri-vrnkiil, .llld ilOO wW iin 




..i .. DlpulKcnRtCWp 



CIRCLE 48 ON READER SERVICE CARD 



PRODUCT BINGO 




Each month Product Bingo features the latest in new soft- 
ware and hardware products of interest to COMPUTER 
LANGUAGE readers. Product Bingo items are based on 
information received from the manufacturer and are not 
meant to be product evaluations, reviews or endorsements. 
To find out more about a particular product simply circle the 
appropriate number on the Reader Service card — you'll 
receive information directly from the manufacturer. 

Note to manufacturers: Send new product information to 
DougMillison, Product Bingo, COMPUTER LANGUAGE, 
137 TownsendSt., San Francisco, Calif. 94107. 

(8)0(8)0(8) 

Application development system 

Data Language Corp. has released Progress, a high- 
performance application development system. In use now on 
AT&T, Fortune Systems, and Convergent Technologies 
machines, Progress will soon be available for the IBM PC AT 
under MS-DOS and Xenix. 

Progress combines a powerful data base management 
system, application language, and an advanced user inter- 
face. Automatic screen and report generation, error recov- 
ery and an on-line tutorial are featured. 

Prices start at $ 1 ,450 for single users and $ 1 ,950 for 
multi-user systems. Query/run-time and plain run-time sys- 
tems are available for sale with applications. A Progress 
Introductory System is available for $295, including on-line 
tutorial, full documentation, and all Progress facilities for 
building a working application limited only by data base 
size. 
CIRCLE 1 1 ON READER SERVICE CARD 

(x)0<8)0(x) 

An APL for the IBM PC 

From Portable Software comes PortaAPL, a complete imple- 
mentation of the standard APL language for the IBM PC and 
other systems. 

Written in C for portability, PortaAPL is extended with a 
full-screen editor, ASCI I character set option, Host File Sys- 
tem Option, and access to machine language functions. For 
faster operations, PortaAPL can work with the 8087 math 
coprocessor on the I BM PC. 

In addition to the IBM PC version ($ 1 ,945), PortaAPL can 
be used on the Motorola 68000 ($395), and DEC VAX 
($2,995). Source and OEM licenses are available. 
CIRCLE 1 1 1 ON READER SERVICE CARD 

®0<E>0<8> 

Now your computer talks back 

When the going gets tough, the tough start talking. To them- 
selves. Now your computer can make it a dialogue with 
RACTER, from John D. Owens & Associates. The author of 
the first book written by a computer program — The police- 
man's beard is half constructed — RACTER boasts the ability 
to produce an original conversation on a variety of topics, 



By Doug Millison 

with an eccentric personality and sense of humor. Available 
now for the IBM PC and CP/M, (coming soon for Apple and 
Commodore), RACTER retails for $69.95. 

If you want to write interactive English, checkout INRAC, 
a prose-creating, high-level programming language. Com- 
mands for parsing input and the ability to call subroutines at 
random allow INRAC to be used to generate original prose, 
avoid stereotypical responses, parody a given literary style, 
or simulate specialization in a given subject. The price for 
INRAC had not been set at press time. 
CIRCLE 11 3 ON READER SERVICE CARD 

<g)0(g>0® 

New S-l 00 master, slave SBCs 

Feature flexibility is the key to Teletek's new SBC 86/87 S- 
100 slave SBC. Options include 1 28K to 5 1 2K RAM, Intel 
8086 CPU at 5MHz or 8MHz, and a 8087 math 
coprocessor. 

The TurboDOS operating system provides CP/M 86 com- 
patibility, while TurboDOS 1 .4 provides a PC-DOS (MS- 
DOS) emulator in a multi-user environment. The SBC 86/87 
sells for $837 in OEM quantities. 

Systemaster II is Teletek's new S-100 master SBC. Simul- 
taneous control of up to four floppy disks is possible. 

Two 64K banks of parity checked RAM provide a TPA of 
over 63K under TurboDOS 1 .3 and 60K under CP/M 3.0. 
Two RS-232 serial ports provide synchronous or asyn- 
chronous communications with software programmable 
baud rates. Systemaster II sells for $679.50 in OEM 
quantities. 
CIRCLE 1 1 5 ON READER SERVICE CARD 

Customize screen input programs 

Programmers using IBM PC, AT, XT, PCjr and true com- 
patibles can generate bug-free customized screen input pro- 
grams quickly with Software Bottling Co.'s Screen Sculptor. 

The source code generated can be modified or merged 
with other programs. IBM BASIC, IBM Pascal, and Turbo 
Pascal capabilities are all included in the package. Screen 
Sculptor sells for $125. 
CIRCLE 121 ON READER SERVICE CARD 

<8>0®0<8) 

Mac Switch makes sharing easy 

The people who brought you Mac Inker are at it again. Mac 
Switch, from Computer Friends, looks like another indispens- 
able device you'll wish you had dreamed up yourself. 

Mac Switch is a manual switch used to connect two periph- 
erals to one computer or two computers to the same periph- 
eral. It is available in two versions: parallel Centronics inter- 
face for printers and serial RS-232 for data communications. 
Mac Switch retails for $99.00. 
CIRCLE 122 ON READER SERVICE CARD 



71 



Six Times Faster! 

Super Fast Z80 Assembly Language Development Package 



^ 



• Complete Zilog 
Mnemonic set 

• Full Macro facility 

• Plain English error 
messages 

• One or two pass 
operation 

• Over 6000 lines/minute 

• Supports nested 
INCLUDE files 

• Allows external bytes, 
words, and expressions 
(EXT1 * EXT2) 

• Labels significant to 16 
characters even on 
externals (SLR Format 
Only) 

• Integral cross-reference 

• Upper /lower case 
optionally significant 



Z80ASM 



• Conditional assembly 

• Assemble code for 
execution at another 
address (PHASE & 
DEPHASE) 

• Generates COM, HEX, 
or REL files 

• COM files may start at 
other than 100H 

• REL files may be in 
Microsoft format or 
SLR format 

• Separate PROG, DATA 
& COMMON address 
spaces 

• Accepts symbol defini- 
tions from the console 

• Flexible listing facility 
includes TIME and 
DATE in listing (CP/M 
Plus Only) 



• Links any combination 
of SLR format and 
Microsoft format REL 
files 

• One or two pass 
operation allows output 
files up to 64K 

• Generates HEX or COM 
files 

• User may specify PROG, 
DATA, and COMMON 
loading addresses 



SLRMK 




• COM may start at 
olher than 100H 

• HEX files do not fill 
empty address space. 

• Generate inter-module 
cross-reference and 
load map 

• Save symbol table to 
disk in REL format for 
use in overlay 
generation 

• Declare entry points 
from console 

• The FASTEST Micro- 
soft Compatible Linker 
available 



For more information or to order, call: 

1-800-833-3061 

In PA, (412) 282-0864 

Or write: SLR SYSTEMS 
1622 North Main Street, Butler, Pennsylvania 16001 



• Complete Package Includes: 280ASM, SLRNK, SLRIB 

- Librarian and Manual for just $199.99. Manual only, $30. 

• Most formats available for Z80 CP/M, CDOS, & TURBODOS 
•Terms: add $3 shipping US. others $7. PA add 6% sales tax 

CIRCLE 59 ON READER SERVICE CARD 

S" L R Systems 



8087 AND 80287 TECHNICAL TOOLS 



87 FFT performs Forward and Inverse FFTs 
on real and complex arrays which occupy up to 
51 2Kbytes of RAM. Also does convolutions, auto 
correlations, hamming complex vector multiplica- 
tion and complex to radial conversions. Callable 
from MS Fortran or 87BASIC/INLINE .... S1 50 

87FFT-2 " performs two-dimensional FFTs. 
Ideal for image processi ng Req uires 87 FFT...S75 

MATRIXPAK" manages a MEGABYTE! 

Written in assembly language our runtime 
package accurately manipulates large matrices 
at very fast speeds Includes matrix inversion and 
the solution of simultaneous linear equations 
Callable from MS Fortran 3.2, 87MACRO, 
87BASIC/INLINE. and RTOS each $150 

DATA ACQUISITION PACKAGE 

Interactive, user-oriented language which allows 
the acquisition and analysis of iarge data 
streams CALL 

GRAPHICS PACKAGES 

Energraphics (stand alone) 295 

Grafmatic for MS Fortran or Pascal 1 25 

Plotmatic for Grafmatic 1 25 

Halo for Basic, C or Fortran each 1 50 

OTHER TOOLS 

Aipha Software ESP 595 

Borland Sidekick, Toolbox or Graphics 45 

COSMOS Revelation 850 

Lattice C 299 

PSI MATHPAK 75 

smARTWORK 895 

SPSS/ PC 695 

STSC APL# PLUS/PC 475 



Micro 
Way 



P.O. Box 79 
Kingston, Mass 
02364 USA 
(61 7) 746-7341 



RTOS - REALTIME OPERATING SYSTEM 

RTOS is a multi-user, multt- tasking real time oper- 
ating system It includes a configured version of 
Intefs iRMX-86. LINK-86. LOC-86, LIB-86. 0H-86, 
and MicroWays B7DEBUG. Runs on the IBM-PC, 
XT, PC-AT and COMPAO 4O0 

INTEL COMPILERS 1 

FORTRAN-86 , 750 

PASCAL-86 750 

PL/M-86 500 

87C (LATTICE/MICROWAY) , 750 

ASM-86 200 

URS" • Universal Run Time System 1 

Generates programs with the Intel compilers 
which run on other operating systems MS-DOS 
version is included with RTOS 
Xenix-286 Version 300 

SoftScope Symbolic Debugger 1 soo 

'Requires RTOS or iRMX-86. All Intel compiler 
names and iRMX-86 TM Intel Corp 

87 BASIC/INLINE™ converts the output of 
the ISM Basic Compiler into optimized 8087 
inline code which executes up to seven times 
faster than 87BASIC, Supports separately com- 
piled inline subroutines which are located in their 
own segments and can contai n u p to 64 K bytes of 
code This allows programs greater than 128K! 
Requires the IBM Basic Compiler and Macro 
Assembler. I ncludes 87 BAS IC $200 

PC AT and 86-31 DRIVES 

30 MEGABYTE WINCHESTER 2000 

53 MEGABYTE WINCHESTER 2600 

SYQUEST FIVE MEGABYTE 950 



VbuCan 
TalkToUs! 



HARDWARE AND LANGUAGES 

8087-3 5mhz $149 

Including DIAGNOSTICS and 180- day warranty 
For IBM PC and compatibles 

8087-2 8mhz $275 

For Wang ATST. DeskPro, NEC. Leading Edge 

80287-3 5mhz $275 

For the IBM PC AT 

64K RAM Set $30 

256KRAMSet $195 

128K RAM Set pc at $225 
NUMBER SMASHER™ call 

1 0mhz 8087 coprocessor board for the IBM PC 
FORTRAN and UTILITIES 

Microsoft Fortran 3.2 239 

IBM Professional Fortran 595 

Intel Fortran-86' 750 

FORLIB+ 65 

STRINGS and THINGS 65 

BASIC and UTILITIES 

IBM Basic Compiler 270 

87BASIC/INLINE 200 

Summit BetterBASIC" 1 75 

Summit 8087 Module 87 

MACRO ASSEMBLERS 

IBM Assembler with Librarian 1 55 

87MACRO 1 50 

PASCAL 

Microsoft Pascal 3.2 209 

Borland Turbo. 45 

Turbo with 8087 Support 85 

NO CHARGE FOR CREDIT CARDS 

ALL ITEMS IN STOCK 
CALL FOR COMPLETE CATALOG 



CIRCLE 57 ON READER SERVICE CARD 



72 COMPUTER LANGUAGE ■ FEBRUARY1985 



SOFTWARE REVIEWS 



Expert team analyzes 21 C compilers 

By Steve Leibson, Fred Pf abler, Jim Reed, and Jim Kyle 




n the early 1970s at 
Bell Laboratories, 
: Dennis Ritchie 
developed his C programming language 
for PDP-1 1 minicomputers. He needed a 
systems programming language for the 
new UNIX operating system created by 
colleague Ken Thompson. The C lan- 
guage has grown in popularity since those 
early days due to its simplicity, elegance, 
and power. 

Today C has left the UNIX environment 
and comfortably resides on other oper- 
ating systems and computers. This special 
review will look at the C compilers cur- 
rently available on the market from a vari- 
ety of operating system perspectives. We 
will cover 12 C compilers and one inter- 
preter running under PC-DOS, six CP/M 
C compilers, two OS-9 C compilers, one 
CP/M 86 C compiler, and one TRS-80 
compiler. (C compilers for the Apple 
Macintosh will be reviewed in the April 
issue.) A list of company names, 
addresses, and phone numbers is included 
at the end of the review. 

Languages have been grouped by oper- 
ating system in the text and in four tables 
on bundled software and essential infor- 
mation (page 75), benchmark results 
(page 79), basic data types (page 99), and 
library functions (page 100). It may not be 
fair to compare language implementations 
across operating system boundaries, but 
such comparisons are inevitable and 
interesting. 

We tested the C languages by installing 
them in appropriate systems. Then we 
attempted to compile and run a suite of 
four benchmark programs on each. 
Details on the benchmarks we used- 
Sieve of Eratosthenes, Fib, Deref, and 
Matrix—arc contained in a sidebar 
(page 82). 

Throughout this review we refer to the 
definitive reference on C — The CPro- 
grammirtg Language by Brian W. Ker- 
nighan and Dennis M. Ritchie. C users all 
over refer to this book simply as K&R and 
we will too. 



MS-DOS/PC-DOS C COMPILERS 

Little doubt exists that MS-DOS, in the 
guise of PC-DOS in the IBM PC family 
and the many compatibles, is the succes- 
sor to CP/M as the most popular micro- 
computer operating system. With the 
addition of tree-structured directories 
introduced with DOS 2.0, this operating 
system clearly targets low-end UNIX 
applications. 

In this atmosphere, many software 
houses have decided to offer C compilers 
for MS-DOS and PC-DOS. As a bonus, 
one company has introduced a C inter- 
preter! We will look at 1 1 of these com- 
pilers and the interpreter in this portion of 
the review. All compilers were tested 
using DOS 3 .0 on an IBM PC with 544K 
of memory and two 360K floppy drives. 

The 8088 processor, with its segmented 
architecture, presents an interesting prob- 
lem for language developers. Pointers can 
be either 16 bits or 20 bits long. This has 
led to the use of four programming mod- 
els, originally set forth in Intel's PL/M 86 
programming language. These models are 
called small, medium, compact, and large 
(or big). 

The small 8088 memory model defines 
separate code and data areas, with each 
area limited to 64K bytes. Thus the total 
program with data included may use a 
maximum of 128K bytes of memory. The 
program stack must also fit in the 64K 
allocated to the data. Programs compiled 
with the small memory model use 16-bit 
pointers. 

The medium memory model limits the 
data segment to 64K bytes, so data point- 
ers within the program are 16 bits long. 
The program, however, is no longer con- 
strained to a 64K block but can extend 
throughout memory. Call and return 
pointers are therefore managed by the 
compiler and linker so that their size is 
appropriate for each instance. 

Programs compiled under the compact 
memory model have separate 64K spaces 
for code, data, and stack segments, while 
a fourth segment, called the heap, can 
occupy the rest of memory. 

The large or big model allows code to 
expand throughout memory, while the 
global data and stack are limited to 64K 
segments. The heap can also extend 



throughout memory, as in the compact 
model. 

Lattice and Microsoft have a slightly 
different set of memory models; the 
small, program, data and large models 
allow for a simpler allocation of pointer 
size. Small programs have a 64K code and 
a 64K data segment. Programs compiled 
with the program model have a 1 MB pro- 
gram space but a 64K data space, while 
programs compiled with the data model 
are limited to a 64K program space and 
have a 1 MB data space. The large model 
allows for both segments to use 1MB. 

Manx's Aztec C 

Let's start off with a fine example of a 
compiler that has many strengths— one 
from Manx Software Systems with the 
unlikely name of Aztec C. Two versions 
of the package are supplied, version 
1 .06D and 2.20B. The earlier version is 
slower but more mature (less bugs), and 
the new version is faster but has not yet 
aged. We tried both versions, and the 
results arc in the benchmark table (Table 
2). Programs compiled with the version 
1 .06 compiler won't link with the version 
2.20 linker and vice versa. You get a "not 
an object file" error. 

Two floating point libraries arc sup- 
plied. One library does not use the 8087 
and the other does. Aztec C supports only 
the small memory model, but it also sup- 
ports overlays, so programs can become 
quite large. The version 2.20 compiler 
has an option to support either the 
8086/8088 or the 801 86/80286. We did 
not quite understand this because the 
80 1 86 is more like the 8086 than the 
80286, however, we did not have the hard- 
ware to test this option. 

No batch files were supplied on the dis- 
tribution disks and we found no recom- 
mended files in the manual, but the syntax 
for the compile and link commands is 
fairly simple. With the compile disk on 
drive A and the source code on drive B, 
CCB: < filename > compiles the pro- 
gram and LN B: <filename > CUB links 
it. 

The Sieve and Fib programs compiled, 
linked, and ran for both versions of Aztec 
C, but we had problems with Dercf and 



73 



Of course, 
POWER! saves 
your Bad Disk. 



NOW! WINDOWS FOR IBM! 




Italsoaoes "r^r *$* 
54 other things to Hp^ 
keep your disk in line. 

EVERYTHING YOU ALWAYS WANTED 
TO DO, BUT WERE AFRAID TO TRY 

Unlike some utility programs that are a headache 
to use, POWER! is engineered to spoil you with 55 
features, simple and uniform commands, and utter 
simplicity of use. POWER! automatically alpha- 
betizes and numbers your files. You select by the 
number and never tvpe tile names again. Need to 
[COPY]. [RENAME], [ERASE], or [RUN] programs? Just 
type in their menu number! POWER! also locks 
out your disk's bad sectors [TEST] without destroy- 
ing files-a critical difference from other utilities 
that search and destroy, without informing you 
what they've done, leaving you to wonder why 
your programs won't run. (And POWER! still has 
50 commands to go!) 

POWER! ONE PROGRAM DOES IT ALL! 

You may own a few utility programs for your com- 
puter housekeeping, each with its own commands 
to memorize. POWER! has all the programs rolled 
into one 16K integrated package, so you do things 
you've never tried before-every day. Save sen- 
sitive data from prying eyes with [PASS] word pro- 
tect, move a block of memory [MOVE], look fur data 
[SEARCH] or compare tiles [CHECK]. POWER! also 
makes easy work of patching, [DISPLAY/SUBSTITUTE], 
customizing software [LOAD/SAVE]. Among the 
other commands are [SIZE], [STATj [LOG], [DUMP]. 
[TYPE]. DUMP], [Fill], [SET], and the CP/M version 
lets you restore erased files-even when you don't 
remember the lilename-at a Hick of the POWER! 
[RECLAIM] command, (Still !il commands to go!) 

POWER! NOW FOR IBM's PC-DOS 
AS WELL AS CP/M 

We first developed POWER! for CP/M two years 
ago, and a stack of testimonials from FORD to 
XEROX testify to its excellence. For IBM-PC" 
users, special features like managing sub-direc- 
tories, [CHANGE], and a separate creation of up to 
8 simultaneous, on-screen [WINDOWS] have been 
added. 

MONEY-BACK GUARANTEE AND 
A 10 DAY TRIAL 

POWER! has the Seal of Approval from the Pro- 
fessional Software Programmers Association, and 
you, too, must be happy with POWER! -or your 
money back ! For only $169 you can now really be in 
control of your computer. Call Computing! at (415) 
567-1634, or your local dealer. For IBM-PC or any 
CP/M machine. Please specify disk format. 



, ■ I <| 

Jl'llii! 



The company that earns its exclamation point. 

COMPUTING! _ 

2519M Greenwich, San Francisco, CA 94123 

TO ORDER CALL 800 TOLLFREE 

800-428-7825 Extension 96M 
In CA: 800-428-7824 Extension 96M 

MM and IBM PC are rmrfmd trademarks of 
intimations! B usine ss Macaittn Corporation. 

CIRCLE 37 ON READER SERVICE CARD 

74 COMPUTER LANGUAGE ■ FEBRUARY1985 



Matrix. Deref had to be reduced to 12 lev- 
els of indirection before Aztec C could 
compile it. At that level, the program 
compiled and linked in 60 sec, ran in 6 
sec, and took 4,352 bytes. 

Our problem with Matrix turned out to 
be library related. A second math library, 
called m.lib, must also be linked with 
Matrix. After that, we had no further 
trouble. 

Manx offers Aztec in several different 
flavors, so you can port your programs 
across a lot of hardware if you need to. 
One interesting aspect of the Aztec C 
compiler is the PRO extension. This 
includes an editor (called z), a symbolic 
debugger, and source files for several of 
the library functions. The PRO version of 
the compiler can generate ROMable code. 
These extensions seem to be quite valu- 
able for serious development work. The 
Aztec C86 compiler for MS-DOS or 
CP/M 86 is $249.00, and the compiler 
with the PRO options is $499.00, 

Supersoft C 

Supersoft C went together a little differ- 
ently from the other packages. It also 
would not fit on one 360K disk so we were 
instructed to put just the library on a sec- 
ond disk. Then a single batch file called 
CM. BAT ran the show. 

When it came time to link in the library, 
the linker paused and asked where the 
library could be found since it wasn't 
where it was supposed to be. This was our 
cue to swap the library into drive A and 
type "A". Well, that didn't work but typing 
"A:" did. Another company that doesn't 
seem to read its own manual . 

At $350, Supersoft C seems a bit 
expensive for a compiler that does not yet 
support floating point. Supersoft says it 
plans to upgrade the compiler to floating 
point but for now it supports Binary 
Coded Decimal floating point through 
float and double declarations, plus some 
special library math routines. It seems 
that although you can declare floats and 
doubles, all you can do with them is pass 
their pointers around. You can't use the 
compiler's intrinsic operators on them. 

Only one memory model seems to be 
supported by Supersoft C, and it appears 
to be the small model. Supersoft C does 
not directly support overlays, but a sec- 
tion in the manual states that Digital 
Research's RASM86 assembler running 
under MS-DOS will support overlay oper- 
ation. Supersoft's linker ELINK supports 
overlays in the CP/M 80 environment. 

In the benchmarks. Sieve compiled and 
ran fine, we had to remove void from the 
Fib program, Deref ran fine, and Matrix 
could not be compiled due to the lack of 
intrinsic floating point math. 

Supersoft C seems to be a software 
package in transition. Until it supports 
full C, wc think it is overpriced. When 
floating point math is added, it will be a 
real contender. 



Computer Innovations' C86 

We liked Computer Innovations' C86 
right away. You have to admire a company 
that names its librarian Marion. However, 
this fondness quickly dimmed . Exe- 
cutable files in C86 are supplied squeezed 
to save room on the disk and must be 
unsqueezed to create the working disk. 
We don't know about you, but wc like to 
get the software out of the box and get it 
running fast. Unsqueezing files is for bul- 
letin boards! 

Learning how to use C86 isn't as easy 
as it might be. No test program is sup- 
plied, although there is a listing in the 
manual. One paragraph is devoted to link- 
ing. We think that this is hardly adequate. 
In the end we stole the link batch file 
LNK.BAT from the C-Systems work 
disk. 

C86 supports the small and big models. 
The 8087 is also supported by a compiler 
option and a special 8087 library. Pro- 
grams compiled with this option selected 
will not run on machines that do not have 
the 8087 coprocessor. Computer Inno- 
vations previously supported overlays, 
but with the addition of support for the big 
memory model, overlays were dropped. 

Sieve compiled and ran fine but Fib 
wouldn't parse. It was then that we found 
out that the C86 manual lists no error 
messages. It only says that error messages 
"should be self-explanatory." We 
wouldn't have looked in the manual if that 
were true, honest. The problem with Fib 
was the void typing again. Removal of the 
offending void allowed Fib to compile and 
run. 

Deref proved to be too complex again. 
Reducing the indirection to 14 levels 
proved to work. At that level of complex- 
ity, Deref compiled in 106 sec, ran in 6 
sec, and took 12,680 bytes. Matrix 
required a ttinchtde <sidio.h > before it 
would compile. 
Wizard C 

There is nothing like a good name to get a 
product off the ground quickly, and we 
like the name Wizard. It makes us feel 
like real hackers. Wizard Systems' Wiz- 
ard C seems to have been written by 
someone who has been in the business a 
while. This especially shows in the docu- 
mentation, which is conversational with- 
out being preachy or snobbish. 

Wizard C barely fits on a double-sided 
floppy. We were finally able to squeeze all 
of the required files onto the disk by delet- 
ing COMMAND.COM. This makes the 
disk unbootable but much easier to use 
during compilation. 

Using a confusing set of compiler 
options, you can generate programs under 
the small, medium, or large model. The 
default is the small memory model. 
Adding the -e option gives you extended 
data, but this option must be used with the 



Bundled software and essentia! information 




Lattice 


c 


$500 


2.13(2.14 
avail) 


MS-DOS, 
CP/M 86 


no 


N.A. 


no 


yes 


no 


2 


no 


OBJ 


yes 


yes 


no 


150 + 


Microsoft 


c 


S500 


2.03 


MS-DOS 


no 


N.A. 


yes 


yes 


no 


2 


no 


OBJ 


yes 


yes 


no 


150 + 


Microsoft 


c 


S450-500 


3.00.13 


MS-DOS 


no 


N,A. 


yes 


yes 


no 


4 


yes 


OBJ 


yes 


yes 


no 


832 


Mark 
Williams 


MWC86 


SSOO 


2.0 


MS-DOS, 
Coherent, 
CP/M 86, 
ISIS, RMX, 
VAX/VMS 


no 


yes 


yes 


yes 


yes 


4 


yes 


OBJ 


yes 


yes 


no 


238 


Rational 


Instant C 


S495 


.9(1.0 


MS-DOS 


yes 


no 


N.A. 


N.A. 


yes 





N.A. 


N.A. 


no 


yes 


no 


175 


„ Systems 






avail] 




























'5. Wizard 
| Systems 

u 

to 


Wizard C 


S450 


l.3|2.0 
avail) 


MS-DOS, 

TOS, 

VAX/VMS 


no 


no 


no 


no 


no 


3 


no 


OBJ or 

ASM 


yes 


yes 


no 


243 


O 

£1 Computer 
^ Innovations 


Optimizing 
C86 


S395 


2.20G 
(2.20J 


MS-DOS, 
CP/M 86 


no 


no 


no 


yes 


no 


4 


yes 


OBJ or 

ASM 


yes 


yes 


no 


275 + 


to 

O 

• Supersofl 


C 


S350 


avail) 
1.2 


MS-DOS, 
CP/M, 
CP/M 86 


no 


no 


no 


no 


no 


3 


yes 


ASM 


no 


no 


no 


228 


Manx 
Software 


Aztec O 
PRO 


S498 


2.20B 


MS-DOS, 
CP/M 86, 
Macintosh 


yes 


yes 


yes 


yes 


yes 


1 


no 


ASM 


no 


yes 


no 


400 + 


C-5ystems 


c 


SI99 


2.06(2.08 
avail 2/1) 


MS-DOS 


no 


yes 


no 


no 


yes 


3 


no 


ASM 


no 


yes 


no 


193 


CWare 


DeSmet C 


$159 


2.4 


MS-DOS, 
CP/M 86 


yes 


yes 


yes 


yes 


yes 


3 


no 


.0 


no 


no 


no 


128 


Datolighl 


Small-C 


S40 


2.1 


MS-DOS 


no 


no 


no 


no 


S40 


1 


no 


ASM 


no 


no 


yes 


45 


Ecasoft 


Eco-C 


S250 


3.1(3.2 
avail 1/1) 


CP/M 


no 


yes 


yes 




no 


4 




ASM 


no 


yes 


no 


210 


Alcor 


Alcor C 


$139 


2.01.00 


CP/M, 
MS-DOS 


yes 


no 


yes 




no 


1 




p-code 


yes 


yes 


no 


486 


j> BDS 
'5. 

E 


BDSC 


$150 


1.50a 


CP/M, 
MP/M 


no 


N.A. 


yes(2) 




yes 


2 




CRL 


no 


yes 


no 


184 


| Code Works 

a! 


QIC 


$95.00 


3.2B[3.2C 
now avail) 


CP/M, 
MP/M 


no 


no 


no 




no 


1 




ASM 


no 


yes 


yes 


173 


Software 
Toolworks 


C/80 


$49.95 


3.1 


CP/M, 
MP/M, 
MS-DOS 


no 


yes 


no 




no 


1 




ASM 


no 


yes 


no 


50 


Hendrix 


Small-C 


$25.00 


2.1 


CP/M, 
MP/M 


no 


no 


no 




no 


1 




ASM 


no 


no 


yes 


256 


£ Microware 


C 


$400 


1.1.4 


OS-9 


no 


yes 


yes 


no 


ASM 


2 


yes 


ASM 


no 


yes 


no 


132 


13. 

£ 

v Inlrol 
CJ 
(/) 
O 


c 


$425 


1.55 


OS-9, 
Flex, 

Uniflex 


no 


yes 


yes 


yes 


level 
no 


4 


yes 


ASM 


no 


no 


yes 


218 


m Digital 

^ Research 

o_ 

U 


c 


$500 


1.11 


CP/M 86 
MS-DOS 


no 


yes 


yes 


yes 


no 


2 


no 


OBJ 


yes 


yes 


no 


500 + 


N.A. = Not 


Applicable. 
































Table 1. 



































75 



,<*&«* 






^SSfLeS 



^W 



,<*>* 









.Kp<>» 



6^" \»^„#' 









■.^^rV 






1£^ 



0* 















^ V* 



«*& 



>£<* 






MICROTEC 
RESEARCH 



3930 Freedom Qicie Suite W . Santa Cuts CA %05J 
Mailing Address. PO Bo> 60337. Sunnyvale. CA §4088 
14081 733:2519 • Tele* 'IT!) 4990808 



CIRCLE 71 ON READER SERVICE CARD 



-m option to create a large model pro- 
gram. The -m option used alone generates 
a medium model program. A nice feature 
of the compiler is that it automatically 
invokes the linker, reducing the need to 
babysit the compilation process. 

One very useful program in the UNIX 
C programming environment is LINT. 
This is not something you pick off of your 
clothes but an extended error checking 
program designed to aid in writing code. 
Wizard C'has LINT-type error checking 
built into the compiler. This feature pro- 
duced several interesting warnings during 
compilation of the benchmark programs. 
In addition. Wizard C is supplied with the 
LINT program, and phase one of the com- 
piler can be told to generate lint files 
(.LNT) to be used by LINT. 

The Sieve ;md Fib benchmarks com- 
piled and ran fine, but Dercf struck once 
again. Wizard C came up with the very 
descriptive message "Disaster, Type stack 
overflow." The compiler could only han- 
dle 16 levels of indirection before the 
stack blew. At that level of indirection, 
Deref compiled in 72 sec. ran in 8 sec, 
and required 8,444 bytes of code. Matrix 
required a ^include <sidio.h > before it 
would compile. 

Datalight's Small-C 
As an indication of MS-DOS's lineage, 
we find the migrant Small-C fresh from 
its appearance in the CP/M world. This is 
J. E. Hendrix's version 2. 1 of Small-C, 
retargeted for the 8086 processor family 
by Datalight. Most of the words written 
later on about the CP/M version of Small- 
C apply to the MS-DOS version as well. 
Smatl-C for MS-DOS supports only the 
small memory model, 

Small-C has a loyal group of followers, 
which is most evident from the number of 
programs written in the language appear- 
ing in Dr. Dobb 's Journal over the past 
few years. Therefore, we find this version 
for PC-DOS and MS-DOS to be most 
welcome. 

Small-C requires but is not supplied 
with an assembler and a linker. We used 
the Microsoft macro-assembler MASM 
version 1 .0 and the linker supplied with 
DOS 3.0 in our tests. Two programs sup- 
plied with Small-C were batch file 
CC.BAT, which can be used to automate 
the compilation process, and LL.BAT, 
which docs the same for linking. CC.BAT 
worked fine but LL.BAT would not work 
with version 2.2 of the DOS linker as sup- 
plied. This was due to the specification of 
the bit bucket NUL: as the target for the 
linker's list file. Apparently LINK ver- 
sion 2.2 (supplied with DOS 3.0) prefers 
NUL (without the :). A quick swipe of the 
editor and Small-C was off and running. 

In the benchmark tests, Small-C com- 
piled and ran Sieve with no problem but 
hit the rocks on the other three programs. 
It couldn't compile Fib until references to 



void and unsigned were removed. Then it 
was able to compile and properly run the 
benchmark. Deref requires structures and 
Matrix requires floating point arithmetic 
and two-dimensional arrays. Small-C 
does not support these three features so 
the last two benchmarks weren't compiled 
or run. 

At $40, Small-C really isn't intended to 
be a heavy-duty development tool 
although it can be remarkably useful. It 
serves as a low-cost introduction to the C 
programming language and an instructive 
example of how to write a compiler. 



Small-C is the only MS-DOS C compiler 
we reviewed here which includes the 
source. The library source is also 
included. Thus you can learn how com- 
pilers are constructed and modify the 
existing Small-C compiler 
experimentally. 

C Ware's DeSmetC 

One rung up the price ladder from Small- 
C is a terrific package from C Ware called 
DeSmetC. For $159 you get a load of 




Btrieve and Xtrieve. 

B-tree file access for all your programming 

languages. With the query tool your users demand. 



Introducing a powerful data base com- 
bination for PC application develop- 
ers. Btrieve"'', the most sophisticated 
file access method for your IBM™ PC. 
In single user and network versions. 
And Xtrieve™, a new menu-driven 
query tool that gives you— and your 
users— fast access to information. 

Btrieve: for professional 
programmers. Btrieve provides fast, 
flexible file management for all your 
application development. All your pro- 
gramming languages — BASIC, Pascal, 
Cobol, C. With multikey access to re- 
cords. Automatic file recovery. Unlimit- 
ed records per file. Duplicate, modifiable, 
and segmented keys. 

With Btrieve, you can develop better 
applications faster. 

Xtrieve: easy window interface. 
The ideal complement to Btrieve, 




Xtrieve is the non-programmer's inter- 
face. Xtrieve's full relational capabil- 
ities let users define a virtual table of 
data from multiple files. Then Xtrieve 
speeds them through query building 
with a series of easy-to-follow windows. 

No command language. Xtrieve is 
completely menu-driven, so there's no 
need to memorize command language. 
Or special syntax. Everything you need 
is on the screen. 

Xtrieve features a full range of restrict- 
ion criteria. Online help messages. And 
interfaces to access information from 
Lotus 1-2-3™ and dBase II® files. 

Network capabilities. Network ver- 
sions of Btrieve and Xtrieve allow data 
sharing in PCnet™, NetWare™, Ether- 
Series™, MultiLink™, and OmniNet™ 
LANs. 

For more information or to order, 
contact: 



SoftCraftlnc. 



P.O. Box 9802 #590 Austin, Texas 78766 (512)346-8380 



Suggested retail prices: Btrieve, $245; Xtrieve, 
$195. Btrieve/N (network), $595; Xtrieve/N, 
$395. Dealer inquiries welcome. Btrieve 
requires PC-DOS or MS™-DOS l.X or 2.X; 
Xtrieve, PC-DOS or MS-DOS 2.X. 



Btrieve and Xtrieve, IBM, 1-2-3, dBase 11, PCnet, 
NetWare, EtherSeries, MultiLink, OmniNet, and MS 
are trademarks of SoftCtaft Inc., International Business 
Machines, Lotus Development Corp., Ashcon-Tate, 
Orchid Technology, Novell Data Systems, 3Com Corp., 
Davong Systems Inc,Corvus Systems, and MicioSoft Inc. 



CIRCLE 78 ON READER SERVICE CARD 



77 



/. 



ORDER BACK 
ISSUES OF 

COMPUTER 
LANGUAGE! 



Premier . 
Oct. '84 . 
Nov. '84. 
Dec. '84 . 
Jan. '85 . 
Feb. '85 . 

NAME_ 



. copies x $4.00 = $_ 
. copies x $4.00 = S_ 
.copiesx$4.00=$. 
. copies x $4.00 = $- 

copiesx$4.00 = $. 

copiesx$4,00 = $. 



COMPANY. 
ADDRESS_ 



CiTY, STATE, ZIP 



Send payment and 
coupon to: 



COMPUTER LANGUAGE 

Back Issues 

131 Townsend St. 

San Francisco, CA 94107 



WRITE 

The Writer's Really Incredible Text Editor lives up to its 
name! It's designed for creative and report writing and 
carefully protects your text. Includes many features 
missing from WordStar, such as sorted directory listings, 
fast scrolling, and trial printing to the screen. All editing 
commands are single-letter and easily changed. Detailed 
manual included. Dealer inquiries invited. WRITE is 
$239.00. 

BDS's C Compiler 

This is the compiler you need for learning the C language 
and for >writing utilities and programs of all sizes and 
complexities. We offer version 1.5a. which comes with a 
symbolic debugger and example programs. Our price is 
(postpaid) SI 30.00. 

Tandon Spare Parts Kits 

One door latch included, only $32.50. 

With two door latches S37.50. 

Door latches sold separately for S7.00. 

All US orders are postpaid. We ship from stock on many 
formats, including: 8", Apple. Osborne. KayPro, Otrona. 
Epson, Morrow, Lobo, Zenith. Xerox. Please request our 
new catalog. We welcome COD orders. 



Workman & Associates 

112 Marion Avenue 
Pasadena, CA 91 106 
(818) 796-4401 




«OLV * U 



CIRCLE 68 ON READER SERVICE CARD 




*UNIX System III POWER and sophistication are yours. 

Let THE SOLUTION turn your micro into all you 

dreamed it could be, bringing the Ultimate 

programming environment as close as 

your modem. Just a local call 

from over 300 cities 

nationwide via Telenet 



EXPANSIVE SOFTWARE DEVELOPMENT FACILITIES including Language and Operating System design. 
• LANGUAGES: C, Fortran 77, RATFOR, COBOL, SNOBOL, BS, Assembler + Artificial Intelligence 
programming via LISP, 

• USENET Bulletin Board System— 800 + international UNIX sites feeding over 190 categories, 
typically bringing you more than 160 new articles per day. 
■l. • Interuser and Intersystem mail + 'chat' capability. 
P||, • UNIFY: Sophisticated data-base management system. 

^j V • UNIX & System enhancements from U.C. Berkeley and Korsmeyer Electronic Design Inc. 
. g? * Online UNIX manuals + Expert consultation available. 

^ , , • SOLUTION-MART: Hardware/Software discount shopping database. 
• LOW COST and FAST response time, 

(as low as $8.95 hr. connect time + $.05 cpu sec. non-prime) 
• $24.95 = 1 hr. FREE system time + SOLUTION News subscription + BYTE 
BOOK (Introducing The UNIX System 556 pp.). 

—■ * UNIX is a trademark o! Bell Labs. 



uH 




Payment via VISA or Master Card 



— ELECTRONIC DESIGN, INC - 

CIRCLE 34 ON READER SERVICE CARD 



5701 Prescott Avenue 
Lincoln, NE 68506-5155 
402/483-2238 
10a-7p Central 



Benchmark results 






Compiler 

Lattice 


Compile 

time 
(see) 

98 


-Sieve — 
Run 
time 
(sec) 


Size 

(bytes) 

(sec) 


Compile 
time 

(see) 


-Fib- 
Run 
time 
(sec) 

58 


Size 

(bytes) 

(see) 

13,710 


Compile 

time 

(see) 

90 


-Deref- 
Run 
time 

(see) 


Size 
(bytes) 


Compile 
time 


- Matrix - 
Run 
time 


Size 
(bytes) 




11 


21,902 


80 


13 


13,726 


163 


29 


25,176 




Microsoft 
(2.03) 


103 


11 


19,754 


81 


57 


11,578 


90 


13 


11,578 


99 


28 


22,722 




Microsoft 
(3.0) 


102 


11 


6,926 


109 


72 


6,924 


104 


10 


6,940 


— 


— 


— 


aj 


Mark 
Williams 


79 


12 


6,887 


81 


— 


6,869 


79 


11 


6,874 


107 


29 


10,847 


a. 

E 

u 


Rational 
Systems 


4 


41 


640 


3 


176 


640 


— 


— 


— 


8 


35 


1,408 


O 
Q 
O 

D_ 

-*, 
(A 

o 


Wizard 
Systems 


74 


12 


16,490 


76 


52 


8,444 


— 


— 


— 


84 


16 


18,826 


Computer 

Innovations 


111 


13 


12,729 


112 


46 


12,728 


— 


— 


— 


134 


27 


13,766 


a 
in 


Supersoft 


132 


28 


13,112 


114 


47 


4,738 


119 


15 


4,822 


- 


- 


- 


i 


Manx 1.06D 


63 


17 


4,448 


58 


82 


4,384 


- 


- 


- 


94 


21 


7,920 




Manx 2.20B 


64 


11 


4,448 


61 


61 


4,448 


- 


- 


- 


92 


16 


7,840 




C-Systems 


119 


19 


27,716 


112 


58 


19,456 


- 


- 


- 


191 


22 


31,114 




CWare 


49 


12 


6,656 


48 


44 


6,656 


49 


11 


6,656 


55 


17 


7,168 




Dalalight 


94 


40 


14,182 


82 


76 


5,861 


- 


- 


- 


- 


- 


- 




Digital 
Research 


108 


12 


27,136 


109 


43 


1 8,944 


145 


14 


18,944 


145 


18 


31,872 




Ecosoft 


93 


39 


14,464 


39 


83 


- 


78 


15 


- 


154 


18 


- 


E 


Alcor 


25 


215 


1,024 


30 


- 


- 


- 


- 


- 


- 


- 


- 


'5. 
E 


u 


BOS 


25 


48 


3,840 


27 


113 


3,840 


25 


12 


3,712 


- 


- 


- 


Code Works 


67 


48 


12,160 


67 


104 


4,352 


46 


12 


4,352 


- 


- 


- 




Software 
Toolworks 


117 


26 


12,288 


114 


57 


3,584 


— 


— 


— 


172 


20 


12,288 




Hendrix 


270 


58 


16,640 


- 


- 


- 


- 


- 


- 


- 


- 


- 




Microware 
{from disk) 


111 


15 


3,873 


Ill 


54 


3,812 


— 


— 


— 


151 


43 


8,207 


'5- 
£ 


Microware 
(from RAM] 


72 


12 


3,873 


74 


12 


3,812 


— 


— 


— 


112 


40 


8,207 


u 

o 

O 


Introl 
{from disk) 


195 


17 


7,618 


195 


34 


7,546 


191 


14 


7,567 


246 


29 


8,370 


Introl 
(from RAM] 


— 


11 


7,618 


— 


28 


7,546 


— 


8 


7,567 


— 


22 


8,370 


_o 
'a. 
E 




Digital 

Research 

(CP/M-86) 


158 


12 


28,672 


155 


43 


20,480 


153 


14 


20,480 


195 


18 


34,816 


o 

CO 

a? 


Digital 

Research 

[MS-DOS) 


108 


12 


27,136 


109 


43 


18,944 


145 


14 


18,944 


145 


18 


31,872 



Table 2. 



79 



EVERY PROGRAMMER/ANALYST NEEDS . . . 



BEMffiM 



THE STRUCTURED PROGRAMMING TOOL! 





40* 








! 










I 




I 












1. DESIGN 

PROGRAMS 




2. CODE 
PROGRAMS 




3. DOCUMENT 
PROGRAMS 
























1 


I 


I 


BUILD DATA 

STRUCTURE 
DIAGRAMS 


BUILD PROG 
STRUCTURE 
DIAGRAMS 


ASSIGN 

EXECUTABLE 
OPERATIONS 


GENERATE 

SOURCE 

CODE 


"FILE" 

DIAGRAMS 
ON DISK 


"LIST" 
DIAGR 
ON PR 






AMS 

INTER 










1 O O i O 


O | O O I O 


ADA 


C 


DBASE II 
COMMAND 

FILES 


PASCAL 


PL/I 


STRUCTURED 
BASIC 


SCHEMATIC 
LOGIC 



Design your programs right on the screen using modern techniques based on the popular Jackson 
Structured Programming method (JSP)! 

DEZIGN is more than just another flowcharting tool. It is an integrated tool for designing and 
documenting programs and for generating source code in any of the languages listed above! 

DEZIGN enables a software developer to create Data and Program Structure Diagrams using the 
Sequence, Selection, and Iteration constructs; assign detailed statements to the Diagrams; and 
synthesize source code from the control logic represented on the Diagrams and the detailed 
statements assigned to them. 

DEZIGN lists for $200 and is available directly from Zeducomp, from IBM and Zenith personal 
computer dealers, and from software retailers. 

• DEZIGN-PC runs under DOS 2.0 and 2.1. 

• DEZlGN-86 runs under CP/M-86 1.1 and Concurrent CP/M-86. 

• DEZIGN-1 6 runs under ZDOS on Zenith Z-1 00 computers. 

"Principles of Program Design," by M. Jackson, Academic Press, describes the JSP metholology 
and is available for$50 directly from Zeducomp and from most professional/technical bookstores. 




P.O. BOX 68 • STIRLING, NJ 07980 • (201) 755-2262 



dBASE II is a trademark of Ashton-Tate, Inc. 
CIRCLE 91 ON READER SERVICE CARD 



software — a complete development .sys- 
tem, in fact. You start with a screen editor 
geared to the IBM PC. You can pay well 
over S159 for just an editor and we have 
just begun. 

Next is the compiler. It isn't a small 
compiler at all. but a nearly full K&R 
implementation. What's missing? Well, 
some of the data types, preprocessor com- 
mands, storage classes and an operator or 
two. But these omissions didn't stop 
DeSmct C from compiling and running 
the four benchmarks with no 
modifications! 

The compiler supports only the small 
memory model but makes up for the 
memory limitations by supporting over- 
lays. Support is also available for the Intel 
8087 numeric coprocessor. Two libraries 
are supplied with DeSmct C. One sup- 
ports floating point calculations with 
assembly language routines and the other 
uses the 8087. 

Also included in this software bargain 
bonanza are a binder (linker), an assem- 
bler, a performance profiler (!) and a 
librarian. The linker is necessary because 
the DcSmet compiler output is not the 
.OBJ file the DOS linker can use. The 
assembler is not needed for the com- 
pilation of C programs. It is a parallel 
development tool for routines that must be 
coded in assembly language for effi- 
ciency. The assembler produces object 
files compatible with the DcSmet binder. 
Do you know what a profiler is? It is a 
jolly little utility that uses the IBM PC's 
real-time clock to generate a histogram of 
your program's operation. It docs this by 
latching on to a periodic interrupt and 
sampling the instruction pointer (IP) at 
each interrupt. The value in the IP is used 
to increment one of ! ,024 counters or 
"buckets". The result is a good approxi- 
mation of where your program spends its 
time. Current versions of DcSmet C allow 
the profiler to work symbolically. 

We did not have a chance to work with 
the DcSmet debugger or librarian, but 
they would appear to be most adequate 
from the documentation. Speaking of the 
documentation, we get to our only com- 
plaint about DcSmet C. For SI 59, we 
think C Ware could afford a vinyl 3-ring 
binder. The documentation is good, but it 
needs packaging. 

Finally, DeSmet C was the easiest DOS 
C compiler to bring up. Twenty minutes 
out of the box, it compiled a program. 
That includes the time it took to create 
working copies of the compiler and 
binder. It worked just like the instructions 
said it would too! Truly a miraculous 
package. 

C-Systems C 

Returning to earth, we look at C-Systems 
C. This compiler is more a complete 
implementation of K&R although still not 
a full version. C-Systems C docs not come 



with an assembler or linker. Using the 
DOS assembler and linker, the complete 
development package of compiler, assem- 
bler, linker and library won't fit on one 
360K floppy disk. Thus you will need a 
compile disk and a link disk and will be 
swapping between them unless you have a 
hard disk or RAM disk. 

The compiler supplied for $199.00 sup- 
ports the small and big memory models. 
Libraries for the compact and medium 
models are S50.00 each. Library source is 
not included but is available at an extra 
charge. The 8087 is also supported. It can 
be sensed automatically or the compiler 
can be instructed to assume that an 8087 
will be present, for maximum 
performance. 

This compiler did not work the way the 
manual said it would. A batch file called 
CC.BAT is supplied to run the com- 
pilation. You are supposed to have your 
source on drive B and the compile disk on 
drive A. Then, while logged on to B. type 
"a:cc <filename>" and your file will 
compile. Except it won't. CC.BAT 
expects the compiler files to be on the 
default drive, which in this case is B, but 
the files are actually on A. Logging onto 
drive A and typing "CC B: < filename >" 
works ever so much better. You'd think 
they would have tried it, wouldn't you? A 
batch file for linking, called LNK.BAT. 
did work as advertised. 

Another problem we had in running C- 
Systems C the first time was due to our 
own error, with plenty of help from C- 
Systcms. They supply batch file CC.BAT 
and an executable file called CC.EXE on 
the same disk, and we copied them both 
over to our working disk without looking. 
CC.EXE doesn't perform the same as 
CC.BAT, yet it overrides it when CC is 
called from DOS. We shouldn't have 
copied CC.EXE to our working disk and 
neither should you unless you know what 
it does. Our opinion: C-Systems should 
not supply its programs with this potential 
for error built in. 

Though apparently a more complete 
implementation of C than DeSmct, C- 
Systems C had problems in the bench- 
marks. Sieve compiled and ran fine, but 
problems cropped up getting the other 
three to compile. C-Systems C didn't like 
void in Fib, couldn't handle 40 levels of 
indirection in Dcref. and required a 
tfinclude <sidio.li > in Matrix. 

Since the compiler couldn't deal with 
the indirection in Deref, we started reduc- 
ing the level of complexity until the pro- 
gram would compile. The magic number 
was 30 levels of indirection. No values 
were entered in the benchmark table for 
this program since it is not the full pro- 
gram, but at 30 levels of indirection, 
Deref compiled in 106 sec. ran in 9 sec, 
and linked to 19.426 bytes. 




Easy to Use 

Word Processor with the 

Power of BASIC 



VEDIT 
has been 

acclaimed 
for the last 
four years 
the industry 
standard 
in text 
editing. 






p «-forin anc ,, 
BweofUe 



5 -i ? ? 
£ I I J 

°ao 01 

° D q 
c D D 0. 



Now there's VEDIT PLUS. 

VEDIT PLUS is easy to learn, yet 
can do things far beyond ordinary 
word processors: 

• Sort a mailing list 

• Perform arithmetic computations 

• Compare files 

• Edit multiple files of unlimited size 

The power of VEDIT PLUS is equal to 
a high-level language - it gives you: 

• If-then-else decision making 

• Pattern matching 

• User prompts and input 

• An optional Z80 to 8086 translator 

Expect a lot from VEDIT PLUS. It's 
from CompuView - nationally recog- 
nized for user support. 

For a demo disk, more infor- 
mation or the dealer nearest you call 
toll free: 

1-800-327-5895 

VEDIT PLUS is available for prac- 
tically every microcomputer . . .$225 

CompuView 

PRODUCTS, INC. 

1955 Pauline, Ann Arbor, Mi 48103 
(313) 996-1299 • (800) 327-5895 



CIRCLE 40 ON READER SERVICE CARD 



81 



Benchmarks 

The suite of four benchmark programs 
we used in reviewing the C languages 
was taken from a recent article in 
BYTE magazine. 1 Written by Dr. 
David D. Clark, these benchmarks test 
out various features of the languages. 

First, however, we found it neces- 
sary to debug the benchmarks. Some- 
thing must have happened to Clark's 
programs between benchmark testing 
and publication because two of the 
programs listed wouldn't run. If any- 
body would like a copy of our 
reworked benchmarks, written in C, 
they are all available on the 
COMPUTER LANGUAGE Bulletin 
Board Service and on this magazine's 
account on CompuServe. Look for the 
files BENMRK. *. With all the tables 
and lengthy text from this review, 
there was just not enough room in the 
magazine left to print these 
benchmarks. 

The first benchmark we used is the 
ever popular Sieve of Eratosthenes, 
written in a very simple dialect of C. 
This program is also called the prime 
number generator. It is a good test of a 
language's ability to run loops since 
the program has a triply nested loop. 
Sieve computes all prime numbers 
from 3 to 16,38 1 • It does this by 
manipulating an array of 8,191 flags, 
with each flag representing an odd 
number from 1 to 16,381, Even num- 
bers are obviously not prime and thus 
require no flags in the array. At the 
completion of the program, the largest 
prime found (16,381) is printed as is 
the number of primes ( 1 , 899) . All 
compilers were able to run this pro- 
gram and obtain the correct answer. 

The second benchmark, called Fib, 
generates Fibonacci numbers. This is a 
recursive algorithm so the program 
tests the speed of function calls and the 



ability of the language implementation 
to perform recursion. The Fibonacci 
numbers are computed using the fol- 
lowing algorithm: 

lfx<=2rhenF(x) = 1 
lfx>2thenF(x) = F(x-l) + 
F(x-2) 

When the program completes, it prints 
the value of F(24) , which is 46,368. 

Though our third benchmark is a very 
short program, many of the compilers 
had a lot of trouble with it. Called 
Deref, it tests the speed at which a C 
deals with indirection. By setting up a 
nested structure, the program repeat- 
edly accesses a variable through 40 
levels of indirection. This complexity 
of indirection was managed by only a 
few compilers. 

The fourth benchmark was derived 
from a program proposed by BYTE 
columnist Jerry Pournelle. 2 Called 
Matrix, it tests floating point arith- 
metic speed. Since some of the com- 
pilers reviewed in this article do not 
implement floating point arithmetic, 
they weren't able to compile this 
benchmark. C programs don't always 
require floatingpoint calculations so 
the inability to run this benchmark is 
not a terrible blot on a compiler's 
record. 

Still, it is valuable to compare floating 
point performances on those C imple- 
mentations that can run this program. 
The program creates three matrices. It 
then fills (initializes) the matrices and 
computes values by iteratively per- 
forming matrix multiplication and 
addition. This program is designed to 
be very compute-intensive. The final 
value printed is the sum of all elements 
in the C matrix, which is 465,880. 



Rational Systems' Instant C 

And now for something completely differ- 
ent, as Monty Python would sav. Instant C 
from Rational Systems is a C interpreter! 
We felt right at home with Instant C. It has 
the look and feel of C and the texture of a 
BASIC interpreter, all at the same time. 

Imagine instant gratification from this 
language. Type "i+ +" and the value / is 
printed, then incremented. Type " + +i" 
and i is incremented, then displayed. 
Learn C the easy way, with Instant C. We 
debugged all of the DOS benchmark pro- 
grams in Instant C before unleashing the 
nasty old compilers on them. 

The reason we did this is easy to under- 
stand by looking at the compile times in 
the benchmark results table— not a com- 
pile (load) time over 8 sec. But not all can 
be inferred from this table. The incredible 
(200K!) interpreter includes an editor. If 
you load a program with syntax errors, 
the interpreter will instantly switch to the 
edit mode and plunk the cursor on the 
offending character. You won't be able to 
exit this mode until you clean up all of 
your syntax errors or cry uncle (quit). 

Editing is very slick. Type "ED 
< function name> " and only the function 
appears, while the interpreter switches to 
edit mode— modular text editing in the 
context of an interpreter. Some very 
admirable ideas arc written into this little 
piece of code. 

How about those error messages? "I'm 
sorry, but I don't know the word 'num- 
ber'.'' appeared when we had used "num- 
ber" in one place and "NUMBER" in 
another. Being a compiler means never 
having to say you're sorry, but the inter- 
preter seems to have that ability. 

The bad news shows in the execution 
time column in the benchmark results 
table. Interpreters are slower than com- 
pilers by a factor of two or three. Yet look 
at the Matrix execution time. The inter- 
preter approaches the speed of the com- 
pilers in floating point intensive pro- 
grams. This is somewhat intuitive, as a 
floating point routine is the same the 
whole world over, compiler or interpreter. 

Deref was again the heartbreaker. 
Above 16 indirection levels, the syntax is 
too complex for Instant C's parser. At 16 
indirection levels, the program ran, but 
the memory-resident source was 
destroyed. At 14 levels, all was well. 

As to the source being clobbered— the 
copy of Instant C we received was a pre- 
release copy, version 0.9. This problem 
will no doubt be fixed for the released 
version. Let's hope so, this program is too 
good to do without! 

Unfortunately, you may have to do 
without it. At $500, you get a great tool 
for writing and testing functions and mod- 
ules and nothing to compile them after 
they are working. Rational Systems rec- 
ommends that you purchase someone 
else's compiler as a companion to Instant 



82 



COMPUTER tANGUAGE ■ FEBRUARY 1985 



C, but wc think the combined purchase 
price is abil steep. 
On the other hand, if Instant C could 

make you twice a.s productive, just think 
what your company will save not having 
to hire a second programmer. We sin- 
cerely leel that Instant C can have a major 
positive impact on programmer 
productivity. 

Mark William's MWC86 

From the land of the minicomputer and 
the super-microcomputer comes Mark 
Williams Go's MWC86. Originally from 
the UNIX environment (Coherent from 
Mark Williams), MWC86 is a complete 
development system for the MS-DOS 
environment. It includes a compiler, 
linker, assembler, librarian and symbolic 
debugger. 

MWC86 supports both small and large 
models. In addition, floating point librar- 
ies for non-8087 and 8087 use are 
included. The compiler, linker, and one 
library fit on a single disk. 

The manual looks nice. It is typeset and 
has fancy tab dividers. However, it is not 
well indexed and doesn't seem to have any 
error message explanations. The index 
includes only function names and no top- 
ics, so it is almost useless for the begin- 
ner. The lack of error message expla- 
nations is completely unforgivable. 

The csd C-sourcc debugger is this pack- 
age's claim to fame. Included is a vacuum- 
formed template that fits over the IBM 
PC's special function keys. The csd 
debugger completely disassociates the 
debug process from the assembly lan- 
guage level, allowing the programmerto 
deal only with C source code. The 
debugger allows the program to run at full 
speed, and program size does not grow 
because the debugger is being used. On- 
line help screens are also available, mak- 
ing this the most comprehensive debugger 
we have seen for MS-DOS C compilers. 

During compilation of the benchmark 
programs, wc encountered several errors 
and warnings. As mentioned previously, 
these were not explained in the manual 
and we were left to our own resources. 
Ultimately, we were able to compile all 
four of the benchmarks, but Fib did not 
run. In fact it hung the machine, making 
us suspect MWC86*s capacity for 
recursion. 

Microsoft C (Lattice version) 

It is somewhat common knowledge that 
Microsoft C is actually Lattice C 
(reviewed later). This isn't a secret as the 
Microsoft manual lists Lattice as joint 
copyright holder. Since the two compilers 
sell for the same price ($500), it is very 
interesting to compare and contrast the 
two packages. 

Microsoft C was supplied as version 
2.03. This compiler supports the small, 
program, data and large models. The 
Microsoft C compiler does not support the 



8087. but data formats have been made to 
conform to the 8087 definitions. 

No help is supplied for the creation of 
the working disk. This is apparently left 
as an exercise for the user. Microsoft sup- 
plied all files on single-sided disks so 
there was quite a bit of disk swapping 
needed to create the work disks. No batch 
riles were supplied to aid in compilation 
or linking, but sufficient information was 
in the manual for an experienced pro- 
grammer to create these files. A copy of 



K&R was included in the documentation. 

The Microsoft C compiler is a full C 
implementation. It was able to compile 
and run the benchmarks with two mod- 
ifications. The void typing in Fib had to be 
eliminated, and Matrix required the addi- 
tion of Mnclude <stdio.h>. In addition, 
a fluke collision occurred between the 
array c/llj and a procedure called c in the 
standard program entry module. This 




C Productivity Series— 

The Professional's Edge 



Blaise Computing has a 
range of programming aids for 
the most popular C compilers in 
the IBM environment that no 
serious system developer should 
be without. These packages help 
you lo easily access advanced 
capabilities of the hardware and 
operating system, and to finish 
your projects with a substantial 
savingof time and eFfort. With 
software development costs and 
pressures as great as (hey arc. 
can you afford not to take advan- 
tage of the finest tools available? 

* C TOOLS" puts advanced 
string handling functions at 
your disposal and provides a 
high-level interface to all 
BIOS functions from your C 
program. Complete screen 
handling, graphics primi- 
tives, and a substantial group 
of useful, general-purpose 
functions arc also featured. $125 

♦ C TOOLS 2 + " lets your pro- 
gram perform all the ad- 
vanced DOS 2.0 services. 
Program chaining, software 
interrupt handling, and dy- 
namic memory allocation are 
all done "right." Buffer and 
file handling functions are 
provided, as well as a gen- 
eral DOS gate. $100 



C VIEW MANAGER" 

our display screen manage- 
ment system that makes 
screen development and doc- 
umentation much faster. It 
comes with a complete 
library of C functions which 
use the screens you have de- 
veloped to recall and display 
information, capture and 
validate field data entry, and 
provide context-relevant 
help files. S275 
♦ ASYNCH MANAGER "is a 
I ibrary of inte rrupt -driven 
routines providing a general 
interface to both COM ports 
for your asy nchronous com- 
munications applications. 
Introductory price of 5175 
includes all source. 
AH of these products may be 
used by developers with no 
royally payments to Blaise Com- 
puting. Source code either 
comes with the package, oris 
available. We support Lattice, 
Computer Innovations, and 
Microsoft C compilers. To expe- 
dite your order or to obtain fur- 
ther information, call or write us 
directly. 

Blaise Computing's Programmer 
Productivity serin is also available in 
versions far the Past nf fanguage. 



BLAISE COMPUTING INC. 

20A4 Blake Street Berkeley. C A 94704 
(415) 540-5441 



CIRCLE 11 ON READER SERVICE CARD 



83 



"This is a beautifully 
documented, incredibly 
comprehensive set of 
C Function Libraries." 

— Dr,>D6bb's Journal 





ESJSSE 



COMPLETE 
SOURCES 

[ PACK I: Building Blocks I 

250 Functions: DOS, 
Printer, Video, Asynch 

I PACK 2: Database 

100 Functions: B-Trees, 
Variable Records 

PACK 3: Communications 

135 Functions: Smart- 
modem™, Xon/Xoff, 
Modem-7, X-Modem 

PACK 4: Building Blocks II 

100 Functions: Dates, 
Text Windows, 
Pull-down Menus 
Data Compression 

PACK 5: Mathematics I 
35 Functions: Log, Trig, 
Square Root 

'-] PACK 6: Utilities I 

Archive, Diff, Replace, Scan, 
Wipe (Executable Files only) 

Lattice™, Microsoft™, DeSmet™, 
CI-86™ Compilers on IBM PC/XT/AT™ 
Small and Large Memory Models. 
Credit cards accepted 
(S7.00 handling/Mass, add 5%) 



SOfTWfW 

traizons 
inc. 

165 Bedford Street 

Burlington, Mass. 01803 

(617) 273-4711 

NOVUM ORGANUM 



CIRCLE 25 ON READER SERVICE CARD 

84 COMPUTER LANGUAGE ■ FE8RUARY1985 



resulted in a doubly-defined symbol error. 
Changing the array name to f/r quickly 
solved this problem. 

Lattice C 

It is apparent that Lattice C version 2 . 13 is 
a later version of the compiler sold as 
Microsoft C, version 2.03. Whole sec- 
tions of the manual are duplicated in both 
versions. Lattice C also supports the four 
memory models: small, program, data, 
and large. Several features have been 
added to the Lattice version since Micro- 
soft obtained the compiler. 

The first addition is 8087 support. Lat- 
tice C will automatically sense the pres- 
ence of the 8087 coprocessor and use the 
appropriate routines. Another addition is 
in expansion of the library to include 
more extensive mathematical functions. A 
fork/waif capability has been added which 
allows a program to create a child process 
and wait for it to complete. 

One addition we particularly appre- 
ciated was an executive program called 
LC. which manages the compilation of 
programs. This replaced the batch file we 
created for Microsoft C. Unfortunately, 
no corresponding program is supplied for 
linking, so we used the file developed for 
Microsoft C, with suitable modifications. 

We found the Lattice C manual to be 
quite complex. It is haphazardly assem- 
bled in three sections. The first section is 
a supplement containing the additions in 
version 2. 10 of the compiler. The large 
middle section is the functional descrip- 
tion of Lattice C, revision 2. The lust sec- 
tion is a set of technical bulletins updating 
the first section supplement with the addi- 
tions made in versions 2.10, 2.11, and 
2.13. Finding information in this con- 
fusing array of pages is not very easy. 
Unlike the Microsoft compiler, Lattice 
does not include a copy of K&R with its 
manual. 

Ignoring the manual. Lattice C is the 
most comprehensive compiler we have 
reviewed for MS-DOS. Its memory 
models, 8087 and library support provide 
a very full-featured compiler. If Lattice 
only supplied a debugger, it would be a 
most complete development system. 

Lattice C was able to compile all of the 
benchmark programs, but Fib required 
the deletion of the void typing, and Matrix 
required the addition of ^include 
< stdio. h > . 

While linking Matrix we encountered 
one problem — we got several error mes- 
sages for missing functions. The manual 
was not much help at first. Eventually we 
discovered that Lattice had decided to 
split the library, giving floating point 
functions a separate library. Changing the 
link command cleared this problem up. 
The scattered documentation on the ver- 
sion 2. 13 revisions were at the root of this 
problem, as the other two manual sections 
were quite misleading. 



Microsoft C 3.0 

This compiler is not at all like the C com- 
pilers previously offered by Microsoft. 
Before release 3.0, Microsoft sold 
repackaged versions of the Lattice C com- 
piler. With the release 3.0 package, 
Microsoft introduces a homegrown com- 
piler with very powerful features that take 
very good advantage of MS-DOS. Of 
course, this is to be expected since 
MS-DOS is also a Microsoft product. 

Microsoft has tried to reproduce a 
UNIX-like environment with the release 
3.0 C compiler. This can be seen in the 
compiler environment and the library 
functions supplied. Nothing has been 
retained from the Lattice package. Micro- 
soft does acknowledge its previous com- 
pilers, however, by supplying a con- 
version aid, a file called 
V2TOV3.H. 

The release 3.0 package is very large. It 
has a four-phase compiler, a special 
linker, several libraries, a librarian, and a 
large collection of include files. The man- 
ual is very large and comprehensive. It is 
composed of three sections: a user's 
guide, run-time library reference, and 
language reference. 

The manual recommends a two-disk 
partition for floppy disk systems, placing 
the compiler and include files on one disk, 
with one set of libraries and the linker on 
the second. Unfortunately, we couldn't 
squeeze all of the include files on one disk 
with the compiler. They must have gotten 
somewhat larger since the manual was 
written. The end result is that we highly 
recommend a hard disk for use with this 
compiler. 

Microsoft has abandoned the Lattice 
memory models in favor of the more pop- 
ular Intel-style models. Release 3.0 sup- 
ports small, medium, and large memory 
models. In addition, Microsoft C release 
3.0 supports the keywords near and far, 
which can override the selected memory 
model for data items. Memory model 
selection is made by compiler command 
line options. 

We received a prerelease version of this 
compiler from Microsoft. It was able to 
compile the first three benchmarks with 
no problems, but the Matrix benchmark 
produced an internal compiler error. This 
bug has been reported to Microsoft, and 
we hope it will be fixed by the time the 
compiler is offered for sale. The release 
3 .0 compiler generated fairly compact 
code that ran quickly for the Sieve and 
Deref tests but suprisingly slow in the Fib 
test. In all, we found the new Microsoft 
compiler to be quite impressive and 
expect it to be a contender in the crowded 
MS-DOS C compiler market. 




"THE SINGLE BEST DEBUGGER 
FOR CP/M-80. A TRULY 
AMAZING PRODUCT/' 

LEOH ZOLMAN 
AUTHOR OF BDS C 

I ) Complete Upward Compatibil ty with DDT 

D Simultaneous instruction, register, stack & memory displays 

□ Software in-circuit-emulator provides write protected memory, 
execute only code and stack protection. 

□ Fifteen single keystroke commands 

□ Thirty day money back guarantee 

[~i On-line help & 50 page user manual 

ONLY $195. 
IBM PC VERSION AVAILABLE SOON! 



-SOFTADVAIMCeS - 

P.O. BOX 49473 AUSTIN, TEXAS 7876S (512) 478-4763 




VISA 



mm 



•We 



\-m ■ : ■ -■ -m m n ■ ■ • 

'* '" &$■* f^'"' ■■-*■■? 



JB ■ ■ K H H- H'* 



m' 



W : * M 



'■■ -■ ■ ■■ 



CIRCLE 77 ON READER SERVICE CARD 



WALTZ LISP™ 

The one and only adult Lisp system for CP/M users. 

Waltz Lisp is a very powerful and complete implementa- 
tion of the Lisp programming language. It includes 
features previously available only in large Lisp systems, tn 
fact. Waltz rs substantially compatible with Franz (the Lisp 
running under Unix), and is similar to MacUsp. Waltz is 
perfect for Artificial Intelligence programming. It is also 
most suitable for general applications. 



:h faster ihnn other microcomputer Lisps. • long integers (up to al 1 digits). Selectable radix • True dynamic 
arocter strings. Full string operations including fast matching/extraction. ■> Flexibly implemented random file access. 

■ Binary files. • Standard CP/M devfces. * Access to disk directories- * Functions a\ type lambda (expr), nlombda 
{fexpr}, leicpr. macro. • Splicing and non-splicing character macros. • User control over all aspects, of the interpreter. 

■ Built-in preitypnnling and formatting facilities. • Complete set of error handling and debugging functions including 
user programmable processing of undefined function references. * Virtual function definitions. * Optional automatic 
loading of irtif<ol»zalion fiSe. » Powerful CP/M command 'me oarsing. • Fast sorting/merging using user defined 
comparison predicates. • Full suite of mopping functions, iterators, etc. * Assembly language interface. * Over ?50 
functions in total. • The be*l documentation ever produced for o micro Lisp (300 -t full size pages, hundreds of 
illustrative examples). 



Version 4.4 



Waltz Lisp requires CP/M-86 or CP/M 2.2, Z80 ond 48K RAM (more recommended). All 
common 5" and 8" disk formats available. 

r>0> («i 

I'ro^^ode 

-INTERNATIONAL— 






*169 



15930 SW Colony Pi. 
Portland, OR 97224 

Unix' Bell LabaralDnei. 
CP/M- Digital Research Corp, 



[Now includes Tiny Prolog 
written in Woltz Lisp ) 

'Manual only: $30 (refundable with order). All 
foreign orders: add $5 for surface mail, $20 for 
airmail. COD add $3. Apple CP/M and hard sector 
formats add $15. 

Call free 1 "800-LI P-4000 Dept #1 
In Oregon and outside USA call 1-503-684-3000 



CIRCLE 60 ON READER SERVICE CARD 



NEW FEATURES 

(Free update for our early customers!) 
» Edit & Load multiple memory 

resident files. 
» Complete 8087 assembler 

mnemonics. 
» High level 8087 support. 

Full range transcendentals 

(tan, sin. cos. arctan. 

logs and exponentials) 

Data type conversion and 

I/O formatting. 

• High level interrupt support. 
Execute Forth words from with- 
in machine code primitives. 

• 80186 Assembler extensions for 
Tandy 2000, etc. 

■ Video/Graphics interface for 
Data General Desktop Model 10 




FORTH 



• Fully Optimized & Tested for: 
IBM-PC IBM-XT IBM-JR 
COMPAQ EAGLE-PC-2 
TANDY 2000 CORONA 
LEADING EDGE 

(Identical version runs on almost all 
MSDOS compatibles!) 

• Graphics & Text 
(including windowed scrolling) 

• Music - foreground and 
background 

includes multi-tasking example 

• Includes Forth-79 and Forth-83 

• File and/or Screen interfaces 

• Segment Management Support 

• Full megabyte - programs or 
data 

• Complete Assembler 
(interactive, easy to use & learn) 

• Compare 

BYTE Sieve Benchmark [an 83 

HS/FORTH 47 sec BASIC 2000 sec 
w/AUTO-OPT 9 sec Assembler 5 sec 
other Forths (mostly 64k) 70-1 40 sec 
FASTEST FORTH SYSTEM 

AVAILABLE. 
TWICE AS FAST AS OTHER 
FULL MEGABYTE FORTHS! 

(TEN TIMES FASTER WHEN USING AUTO-OPT!) 

HS/FORTH, complete system only: $250. 

2S visa Mastercard £$ 
Add $10. shipping and handling 

HARVARD 
SOFTWORKS 

PO BOX 2579 

SPRINGFIELD, OH 45501 
(513) 390-2087 

CIRCLE 47 ON READER SERVICE CARD 



85 



THE j; JOURNAL 

The C Journal will help YOU use c on your machine 
-IBM PC", CP/NT, Macintosh '", or UNlX'"-based - 
micro, mini, or mainframe. 

it's the ONE publication for programmers, software 
managers, and other computer professionals who 
need to keep aware of developments in the indus- 
try's fastest-growing language. 

• regular columns for novice through advanced C 
programmers 

• software product and book reviews 

• tips on working with major compilers and 
operating systems 

• news from the ANSI standards committee and the 
industry 

For FREE sample issue and discount subscription 
information, write, call, or circle our reader service 
number. The C Journal is a quarterly publication, 
and costs $28/year (add $9 for overseas airmail). 



Subscriptions/Advertising: 

Christina Gardner 

(201) 989-0570 



Editorial: 
Rex Jaesche 

(703) 860-0091 



another independent publication from ,— ^— | 
E =-S=^= | Info Pro Systems ^°^ 



P.O. Box 849 \WZIM, 

Denville, NJ 07834 * 



CIRCLE 5 ON READER SERVICE CARD 



OVERCOME 
FORTRAN and PASCAL 

LIMITATIONS WITH 




NO 



LIMIT 



Visa/MC 



Alibraryof 58 Assembler routines transforms MS FORTRAN and PASCAL 
plus other 3086/87/88 FORTRANs into the flexible, responsive, complete 
language needed for the microcomputer environment. Featuring: 

EXTENSIVE GRAPHICS (Get, Put, Paint, Color, Dot, Line, Box, Circle, 
Ellipse, Large Characters) 
(Windows, Cursor, Read/Write Screen) 

(Match, Compare, Concatenate/Extract, Pack, 
Justify, Zero Fill} 

(Read Key Du ring Execution, String Read With 
Edit) 

(Exist?, Rename, Delete) 

(Set Com Line, Send/Receive, Line/Modem 
Status) 

(Peek, Poke, Determine Time/Date, Random 
Numbers, Beep, Clear Screen, OR/AND/ 
XOR/NOT/NEG of Byte/Word, Printer Status) 
For routines to meet language specific problems 
such as Chairing or Command Line Read call: 

M | E | F Environmental Inc. P.O. Box 26537 
Austin, Texas 78755 (512) 251-5543 



FULL SCREEN CONTROL 
STRING MANIPULATION 

KEYBOARD CONTROL 

FILE MANAGEMENT 
COMMUNICATIONS 

OTHER FEATURES 



TESDCS TCCLS 

HO DEI S II, 12, 16 

TRSiC C COMPILER 

Full K&R with source to the 

function library. UNIX 

compatible $85.00 

ZSPF EDITOR 

SPF, the choice of most 

mainframe programmers, is 

now available for Z80 machines. 

And it's panel driven so you 

can customize it! $75.00 

MODEL IOC C CCMDIEED 

Now you can write efficient programs for your TRS-80 
model 100 with ease. Or, learn the essentials of C 
programming while traveling! 

C/100 - THE "PORTABLE" C COMPILER 

Cassette version $49.00 

Disk/Video interface version. . $59.00 

Model II version (run on mod ll.then download 

object code !o model lOO) $79.00 

Model III version (as above, loi Mod III) $79.00 

Write or call for information on other TRS-80 software. 

TBSOOS and IRS 60 die Eiademarks o' T.m.!, CO'P 



business utility snftuiare 

IDS minna ste 4E3 san franciscn ca 94IDS 

(415)397-2000 



CIRCLE 55 ON READER SERVICE CARD 

86 COMPUTER LANGUAGE ■ FEBRUARY1965 



CIRCLE 17 ON READER SERVICE CARD 



OPT-TECH SORT 



SORT/MERGE program for IBM-PC & XT 

Now also sods dBASE II files! 

Written in assembly language for high performance 
Example: 4,000 records of 128 bytes sorted to give 

key & pointer file in 30 seconds. COMPARE! 
Sort ascending or descending on up to nine fields 
Ten input files may be sorted or merged at one time 
Handles variable and fixed length records 
Supports all common data types 
Filesize limited only by your disk space 
Dynamically allocates memory and work files 
Output file can be full records, keys or pointers 
Can be run from keyboard or as a batch command 
Can be called as a subroutine to many languages 
Easy to use, includes on-line help feature 
Full documentation — sized like your PC manuals 
S99 —VISA. M/C. Check, Money Order, COD. or PO 
Quantity discounts and OEM licensing available 

To order or to receive additional information 
write or call: 

OPT-TECH DATA PROCESSING 

P.O. Box 2167 Humble. Texas 77347 

(713) 454-7428 

Requires DOS. 64K and One Disk Drive 

mill i i — !^— saw 1 

CIRCLE 66 ON READER SERVICE CARD 



COMPILERS FOR CP/M 

Recent years have witnessed a growing 
support forC running under CP/M, start- 
ing with Small-C and progressing to 
ECO-C's highly professional imple- 
mentation. This support has seeded a 
large and continually growing body of 
software written for the CP/M 
environment. 

J.E. Hendrix's Small-C 
The original version of Small-C was pub- 
lished in Dr. Dobb 's Journal in May 1980 
by Ron Cain. In its original form, Small- 
C was a simple one-pass compiler that 
generated assembly language text for the 
8080 processor. It recognized only char- 
acters, integers, and one-dimensional 
arrays of each. There were no Boolean 
operators so bitwise logical operators 
were used. The only loop control was the 
while statement. 

The compiler was updated and 
extended by Jim E. Hendrix and pub- 
lished again in Dr. Dobb 's Journal in 
December 1982. The new compiler, 
dubbed version 2.0 Small-C, has been 
extended by the addition of code opti- 
mization, data initialization, conditional 
compilation, the EXTERN storage class, 
the/or, do/while , switch , and goto state- 
ments, assignment operators. Boolean 
operators, the one's complement operator, 
and assorted other features. 

Since his article appeared, Jim Hendrix 
has published The Small-C Handbook , 
which does an excellent job of documen- 
ting the essential features of the compiler. 
The book, in combination with a disk of 
the compiler sources, would make an 
excellent semester course on the structure 
of seed compilers. 

The Small-C compiler at $25 , with the 
book S 14.95, brings this tool in at the low- 
est price of any of the compilers we have 
reviewed for CP/M. The combined price 
tag of $39.95 is a good investment, as the 
compiler makes an excellent tool for 
doing small utility development in the 
CP/M environment. Be aware that it 
implements only a subset of the full 
language. 

Disk one contains the compiler 
CC.COM, several submit files, a read. me 
document, and order forms for the use of 
people who wish to get their own copy of 
Small-C. The read. me document deals 
with a problem seen with using certain 
versions of M80. The only instantly 
apparent source file is called AR.C. We 
displayed the source file and discovered 
that it is a program archiver and the 
assorted .ARC files on the disk are 
archived sources for the system. A submit 
file connects the compilation, assembly, 
and link portions of building a program. It 
seems as if almost everything has been 
thought of. The documentation consists of 
a copy of The Small-C Handbook . 

The largest plus we see to Small-C is 
that in combination with The Small-C 



Handbook you have a ready tool to learn 
about what a compiler is and how it 
works. The compiler does not try to deal 
with the entire language so it is somewhat 
simpler and easier to read. Modifying the 
compiler to extend the language is quick 
and easy. 

The Small-C compiler is in the public 
domain and virtually free. What you are 
paying for when you purchase the pack- 
age is the right to be in on any updates and 
fixes that come along, which is explained 
in the file REGISTER on the disk. It is 
your least expensive step into the C lan- 
guage . If you try it out and find it's not to 
your taste, you haven't made a heavy 
investment. If you find that you like C, 
then in the future you can move up to a 
bigger implementation. 

But be warned , do not expect to do 
large-scale development in Small-C. 
More comprehensive versions of the lan- 
guage are out there. Many of the more 
powerful extensions of C would make 
some rather long and tedious Small-C 
programs quite a bit shorter and more 
concise. 

Small C could run only one of the 
benchmarks. Lack of floating point sup- 
port and one-dimensional arrays pre- 
vented the Matrix program from com- 
piling, lack of unsigned integers kept Fib 
from compiling, and lack of structures 
stopped Deref. 

Also be warned that if you do not 
already have an M80 compatible relo- 
cating assembler, and a linker, you are 
going to have to get one in order to use 
Small-C. Jim Hendrix does not supply 
one with the package. Output of the com- 
piler is assembly language source. 

Small-C is not unique in offering the 
entire compiler source as part of the com- 
piler package. It was just the first. If you 
need to fill a special niche in your tool 
chest, then Small-C may fit the bill . 

Software Toolworks' C/80 

Software Toolworks' C/80 is a late entry 
into the CP/M group of compilers. Fitting 
between J.E. Hendrix's Small-C and The 
Code Works' Q/C, it is the least expensive 
of the C implementations offering a float- 
ing point package. The compiler comes 
with a configuration program and an 
assembler. The total package with Math- 
Pack and the compiler costs about $90. 
For the price it seems to be a reasonable 
implementation of C. However, it is not as 
close to K&R C as the advertising would 
like you to believe. 

This compiler does sport some rather 
impressive benchmarks, taking just 26 sec 
to run the Sieve test. It then promptly 
turned around and exploded on Deref. We 
don't know what happened. It got lost and 
filled the screen with garbage when 



Pascal and C 

Programmers 



Your programs can 
now compile the 

FirsTime- 



FirsTime is an intelligent editor that 
knows the rules of the language being 
programmed. It checks your statements 
as you enter them, and if it spots a 
mistake, it identifies it. FirsTime then 
positions the cursor over the error so 
you can correct it easily. FirsTime will 
identify oil syntax errors, undefined 
variables, and even statements with 
mismatched variable types. In fact, any 
program developed with the FirsTime 
editor will compile on the first try. 

Unprecedented 

FirsTime has many unique features 
found in no other editor. These powerful 
capabilities include a zoom command 
that allows you to examine the 
structure of your program, automatic- 
program formatting, and block 
transforms. 

If you wish, you can work even faster 
by automatically generating program 
structures with a single key-stroke. This 
feature is especially useful to those 
learning a new language, or to those 
who often switch between different 
languages. 

Other Features: Full screen editing, 
horizontal scrolling, function key menus, 
help screens, inserts, deletes, appends, 
searches, and global replacing. 

Programmers enjoy using FirsTime. It 
allows them to concentrate on program 
logic without having to worry' about 
coding details. Debugging is reduced 
dramatically, and deadlines are more 
easily met. 

FirsTime for PASCAL $245 

FirsTime for C 5295 

Microsoft PASCAL Compiler $245 

Microsoft C Compiler $395 

Demonstration disk S25 

Get an extra S100 offthe compiler when 

it is purchased with FirsTime. 

(N.J. residents please add O'.'fi sales tax.) 



Spruce 

Technology Corporation 

I 10 Whispering Pines Drive 

Lincroft, N..I. 07738 

(201) 741-8188 or (201) 663-0063 

Dealer enquiries welcome. Custom versions 
for computer manufacturers and language 
developers are available. 

FirslTima is a iradi'mark r>r Sprues Technoiiigy 

Oirpnralion. r T^^H i^i^i^H 

VISA' 



CIRCLE 33 ON READER SERVICE CARD 



87 



Thunder Software 



• The THUNDER C Compiler- Operates und^r the APPLE Pascal ! I ap*tfsflngs^em.Createf*«tm[ tvnSl 12 programs ronjn 
as Stand alone programs or as subroutine To PdwaiptogratUk ABaior*uKi.'t ol the CcJeiWd byKX; R Includes a 24 page users 
gut eta. newsletters. Marm p^e^:>^:OkiasEH:"ra^ , : rn APP1JE If J t" 1 "- . «? -'V" Source code for I hraries Is Included Oniy $49*95 

• ASSYST: The .WraWei Sytttem - A comptete6502 editor/ assembler and IisTtir for APPLE DOS3 3 Menu driven excellent 
error trapping. 24 p uwrsgudt?. demo programs *<iuwe isode.ifls all programs! Gfed! lor be jiniv.'^ Only $23.50 

• THUNDER XREF- A cross reference utility for APPLE Pascal 11 XRKI'iii^iLr.ttescro^sr^erertct ^l'irr<i. !i pTocedurt 3 Snimv 
code and dncumerntiillnn provided Only Si 9.95 



Thunder Software POB 31501 Houston Tx 77231 713-728-5501 
Include S3.00 shipping. COD. VISA and MASTERCARD accepted 



CIRCLE 65 ON READER SERVICE CARD 




♦ Compilers: 

CLC86 S349 

Lattice S395 

Mark Williams . . . $475 



♦ General Libraries Si 75 

(Lattice, Microsoft, Mark 

Williams, CI C86) 

♦ DeSmet C S150 

♦ Comm Library ...... S 1 60 

GREENLEAF SOFTWARE, INC. 

2101 HICKORY DRIVE ♦ CARROLLTON, TX 75006 ♦ (214)446-8641 



GREENLEAF 

SOFTWARE r 



CIRCLE 44 ON READER SERVICE CARD 



MEMO: Qpxotfuvnmzu ^^ 

QUIT >^ 

WORKING 

SO HARD, 

These people have quit working so hard: IBM, Honeywell, Control Data, 
GE, Lotus, Hospitals, Universities & Government Aerospace. 

THE GREENLEAF FUNCTIONS™ 

THE library of C FUNCTIONS that probably has just what you need . . . TODAY! 

. . . already has what you're working to re-invent 

. . . already has over 200 functions for the IBM PC, XT, AT, and compatibles 

, , . already complete . . . already tested ... on the shelf 

. . . already has demo programs and source code 

. . . already compatible wirh all popular compilers 

. . . already supports all memory models. DOS 1.1, 2.0, 2.1 

. . . already optimized (parts in assembler) for speed and density 

. . . already in use hy thousands of customers worldwide 

. . . already available from stock (your dealer probably has it) 

. . . It's called the GREENLEAF FUNCTIONS. 

Sorry you didn't know this sooner? Just order a copy and rhen take a break — 
we did rhe hard work. Already. 

THE GREENLEAF FUNCTIONS GENERAL LIBRARY: Over 200 functions in C 
and assembler. Strength in DOS, video, string, printer, async, and system interface. All DOS 1 
and 2 functions are in assembler for speed. All video capabilities of PC supported. 
All printer functions. 65 string functions. Extensive time and date. Directory searches. 
Polled mode async. (If you want interrupt driven, ask us about the Greenleaf Comm 
Library.) Function key support. Diagnostics. Rainbow Color Text series. Much, much more. 
The Greenleaf Functions. Simply the finest C library (and the most extensive). 
All ready tor you. From Greenleaf Software. 

. . . Specify compiler when ordering. Add $7.00 each for UPS second-day air. MasterCard, 
VISA, check, or P.O. 



attempting the pointer dereferencing. It is 
hoped this problem will be fixed. 

The source code for the lihrarics is 
included in the package with the source 
for the floating point package. Software 
Toolworks has included at least some 
rudimentary verification tools with the 
package. It's a start at least. 

We have a problem with the manual, 
however. The 60 pages includes a 10-page 
blurb on the MathPack. It covers the 
topic, but is reminiscent of the original 
CP/M user's guides that told you every- 
thing you needed to know about CP/M, if 
only you knew where to look. K.&R C and 
C/80 arc going to have several points of 
difference, so if your goal is portability, 
this is not the too] for you. 

Although this compiler docs not live up 
to its advertised claim of being a full C 
implementation, it docs have a place if for 
no other reason than to create blazingly 
fast utilities. Writing a large program 
(over 10.000 lines) with this compiler 
could be a trick. The main effort at least 
initially would be to verify which con- 
structs worked and which were going to 
go out to lunch. 

The Code Works' Q/C 

The second compiler wc examined for 
CP/M was the Q/C compiler from The 
Code Works. This is the only other com- 
piler wc know of that sells the compiler 
package with source. (At least in the 
affordable category.) 

This compiler is a very good step up 
from Small-C for the hobbyist. In particu- 
lar, it has a respectably rich subset of the 
C language. It differs in that it does not 
support long .float . or double declara- 
tions, which again means that Matrix can- 
not be executed for this compiler. Lack of 
support for extended-precision numbers 
does not greatly reduce the value of this 
compiler to the experimenter. The com- 
piler sources are included. 

Q/C. like the other less expensive com- 
pilers, docs not implement parameterized 
^defines . The Q/C compiler also does not 
support the initialization of local, auto , or 
register variables. Because Q/C is imple- 
mented as a single-pass recursive descent 
compiler, local variable declarations are 
only supported immediately after a func- 
tion header; local variables within blocks 
and bit fields are not supported. 

The preceding list is not particularly 
extensive for a compiler in the SI 00 
range, particularly one distributed in 
source form. Educators needing a good 
tool with its own programming course 
should look long and hard at this product. 

Wc particularly like tvvo features avail- 
able with this compiler. The first is that 
the compiler is available to create code for 
one of two processors: 8080 or Z80. The 
Z80 version generates only M80 (or 
CWA— the optional Code Works assem- 
bler) mnemonics because of optimizations 
for the Z80 processor. The 8080 version 



88 



COMPUTER LANGUAGE ■ FEBRUARY19B5 



oes not support Zilog mnemonics. 
The second feature we liked is trace . 
Vhen turned on, the compiler generates 
ode that displays the name of each func- 
ion when it is executed. This sounds 
.andy for tracing down hard to find or 
nvisible problems. The trace feature also 
auses the compiler to search for trace 
lags placed within comments and to gen- 
rate the code necesary to output the text 
vithin the trace flag text area. 

The manual is excellent. It starts off 
vith an introduction by the author. The 
"irsl chapter shows a sample compilation 
ising each of the recommended assem- 
blers. It also covers the QRESET pro- 
gram, which is used to change certain 
parameters within the compiler (size of 
:he symbol table, macro storage, default 
Dptions, etc.). This is a reasonable way 
of dealing with the limitations of a small 
machine. The sources for QRESET are 
part of the source library. 

This manual, however, does have one 
failing: it has no index. Most of the mate- 
rial is well-organized, but certain things 
are hard to find, such as information on 
EXPAND.COM. This is not serious 
because of the manual's good general 
organization, just a nuisance. 

The Q/C compiler, by Jim Colvin, has a 
lot to recommend it. Sources are included 
as part of the package. This means that 
self-maintenance is possible for the hob- 
byist, and the resource material made 
available to the instructor makes it a must 
acquisition. The price tag of close to $100 
is not totally intimidating. 

Some of the compiler's features (e.g. 
trace) are unusually good ideas. We 
would like to have this feature on some of 
the VAX cross compilers we use at work. 
In particular, the ability to embed trace 
flags and debug text for output in com- 
ments is one of those things that make you 
hit yourself and say "Why didn't I think 
of that?" Other features, such as the abil- 
ity to compile code for multiple assem- 
blers, indicate the author has run into the 
new compiler syndrome: being able to do 
the compilation but not having the assem- 
bler to finish the job. Very frustrating. 
Q/C is a small machine compiler. It 
does what it is meant to do and it does it 
well . The compiler is shipped set to com- 
pile code modules with 200 symbols in its 
symbol table. This can be changed. Still, 
it indicates an inherent limitation of the 
system. The limit is on the total number of 
symbols per compilation rather than per 
level of scope, which means you may need 
to keep your modules small in order to use 
this compiler effectively. We can't help 
but wonder what the maximum limits on 
these settings would be. 

BD Software's BDSC 

BD Software's BDS C has been used to 
write software for the CP/M operating 



system for about four years. In that time it 
has become one of the most used and 
respected C compilers within the CP/M 
community. The compiler is written in 
8080 assembly language and directly pro- 
duces 8080 code. This is not always a 
desirable feature, but in this case, because 
it is a blindingly fast compiler, it is forgiv- 
able. It is so fast that it can approach the 
convenience of an interpreter for small 
code fragments. BDS C accomplishes this 
speed by loading the entire source file 
from disk into memory and compiling in 
place. 

BDS C is the only CP/M C compiler we 
have reviewed that has seriously exam- 



ined the program verification and 
debugging issue and has provided tools to 
aid in this endeavor. This is accomplished 
using two methods. BDS recognizes that 
the CP/M environment has very effective 
verification tools already available. These 
tools are utilized by producing as an out- 
put from the compiler a standard format 
symbol file. This allows the the C pro- 
grammer convenient access to assorted 
symbolic debuggers supplied by other 
vendors. 

The compiler may also be instructed to 
output 8080 restart (RST) instructions at 



I/O A BORE? NOT ANY MORE! 




ENHANCE 

PROGRAM 

INTERACTION 

ELIMINATE 

SCREEN ENTRY 

ERRORS 



COSTS 



IF RE 1 



~\_ 



REVISE SCREENS 
IN SECONDS 



M|E(F Environmental, Inc. 

P.O. Box 26537 

Austin, TX 78755 (512)251-5543 



S450 : OEM Pricing and Licenses Available 

Demonstration Diskette S 10 

applicable to purchase 



CIRCLE 15 ON READER SERVICE CARD 



89 



CODE SIFTER 

THE EASY TO USE 
SYMBOLIC EXECUTION PROFILER 

No knowledge of assembly language is needed. 

Easy to use - become productive in minutes. 

Online HELP at each menu complements the user 
manual. 

I Define 32 ranges in USER/DOS/BIOS with a single 
keystroke or enter them manually if you desire. 

Use the looping feature to isolate the busy areas of 
your program automatically. 

Symbolic statistical output can be sent to any device 
or file. 

Adjustable sampling rate for increased accuracy. 

Free demonstration diskette available, (requires deposit) 




David Smith Software 

Box 25 A R,D.#3 

Oxford, N.Y. 13830 

(607) 843-6209 



Requires IBM-PC 
128K DOS 2.X 



$119 



IBM is a trademark of International Business Machines Corp. 



CIRCLE 36 ON READER SERVICE CARD 




Eco-C Compiler 

Release 3.0 

We think Rel. 3.0 of the Eco-C Compiler is the 
fastest full C available for the Z80 environment. 
Consider the evidence: 

Benchmarks* 

(Seconds) 



Benchmark 


Eco-C 


Aztec 


Q/C 


Seive 


29 


33 


40 


Fib 


75 


125 


99 


Deref 


19 


CNC 


31 


Matmult 


42 


115 


N/A 




'Ttmes courtesy ol Or David Ctark 
CNC - Could Not Compile 
N/A - Does not support floating point 

We've also expanded the library (120 func- 
tions}, the user's manual and compile-time 
switches (including multiple non-fatal error 
messages). The price is still $250.00 and 
includes Microsoft's MACRO 80, As an option, 
we will supply Eco-C with the SLR Systems 
assembler - linker - librarian for S295.00 (up to 
six times faster than MACRO 80}. 
For additional information, 
call or write: . 




(317) 255-6476 
6413 N. College Ave. • Indianapolis, Indiana 46220 



the beginning of each C statement. This 
allows CDB, BDS's symbolic C debugger, 
to directly control execution of the target 
program by setting breakpoints and allow- 
ing symbolic display and modification of 
variables. This is definitely a step toward 
reducing the drudgery of program 
verification. 

The ability of BDS to quickly compile 
and integrate the resulting code into a 
very good symbolic debugger has gone a 
long way toward making BDS C one of 
the preferred tools in the CP/M program- 
mer's toolchest. 

The release wc reviewed (version 
1 -50a) still suffers from a lack of real 
number implementation. It does, how- 
ever, support a floating point function 
library, which is not integrated at all into 
the compiler. Thus, float, double, and 
long data types are not directly supported. 
Functions similar to the intrinsic long and 
float operations are available from the 
library using byte arrays. 

The C Users Group (formerly the BDS 
C Users Group) is one of the more active 
software-producing users groups in the 
country. The. float and longint package as 
well as the CDB symbolic debugger 
resulted from efforts by members of this 
group. 

Library sources have been included to 
allow customization by users for non- CP/ 
M environments. Along with these are a 
large number of source files. The CDB 
symbolic debugger is included in source 
form. There is a library for directed I/O, a 
utility for command line wild card expan- 
sion, an assembler to assemble to BDS 
C's own .CRL-format relocating libraries 
and the float and longint libraries men- 
tioned previously. Othello (a game!), 
several file utilities, and finally Teledit, a 
large telecommunications program, are 
also included. 

BDS C is one of the best values for an 
all-around useful tool. For $150 you have 
the fastest CP/M compiler on the market. 
If you thought that program turnaround 
was not important, then you have never 
had to do serious debugging. Given the 
difficulty of system development efforts, 
we want all the help we can get in building 
and verifying software. We wish more 
compilers used the intelligence and acute 
sense of reality that BDS C has placed in 
their debugging tools. Many of the 
mainframe-based cross development com- 
pilers have some form of hook into the 
compiled code, which allows a debugging 
system to be integrated into the software. 

Because of the in-memory compilation, 
BDS C is best used for module develop- 
ment. The size of the source code body 
that can be compiled is limited to 48K or 
so in a 64K CP/M environment. In certain 
cases this may impose restrictions on the 
size and number of functions available in 
any one compilation. 



CIRCLE 22 ON READER SERVICE CARD 

90 COMPUTERLANGUAGEBFEBRUARY1985 



The greatest failing of the BDS C com- 
piler has been the .CRL libraries' non- 
standard format. Some sort of conversion 
capability that would convert between 
.REL format and .CRL format libraries 
would be an excellent addition to the sys- 
tem. The new CASM assembler is a good 
addition to the package. It just fails in 
many ways to link with the large body of 
excellent development tools available 
under CP/M. 

AlcorC 

Alcor Systems' Alcor C is one of the two 
CP/M implementations of C in this article 
that could be termed a fitll imple- 
mentation. It has the most comprehensive 
manual of all of the implementations that 
we have reviewed. It is divided into six 
sections: beginners, editor, system, 
tutorial, reference, and Advanced Devel- 
opment Package (ADP). It contains about 
470 pages of information about the use of 
the compiler and editor. It is well laid out 
with a table of contents and index for each 
section. 

The package is divided into three main 
systems and the editor. The first system is 
the compiler and the p-code interpreter. 
The second system is the ADP. It contains 
the p-code-to-native machine conversion, 
the p-code optimizer, and the LinkLoadcr, 
which allows both native machine code 
and optimized p-code functions to be used 
in the same program. 

The LinkLoader allows you the ability 
to profile the program and convert those 
portions requiring high efficiency to 
native machine code while still retaining 
the size efficiencies of p-code for the 
majority of the program. The ADP pack- 
age is offered as an option to the base 
compiler, but for the serious development 
effort it is a must. The third section is 
Alcor's XASM multi-assembler. The 
assembler is not an essential portion of the 
system, but the documentation on the 
assembler contains a complete description 
of Alcor's low-level p-code. This is essen- 
tial fordoing large-scale development in 
this type of environment. 

If your development effort is concerned 
with porting software, this compiler is 
one of the two CP/M C compilers 
reviewed that can do the job. Alcor C is 
very close to being full K&R C. Most of 
the differences from K&R are extensions 
on the base language. Alcor C has only 
two restrictions: the address of an array 
element may not be used as an initializer 
and external float and double variables 
may not be initialized. 

It becomes apparent very quickly that 
p-code implementations have many 
advantages. One of them is the com- 
pletenessofthe implementation. The 
Alcor C language implementation is one 



PERFORMANCE 
PORTABILITY 

team 
I SAN LPZ^GC3Za\(3l1 

gj3£]ffi 

UNBEATABLE 



r* 



ctree 

BY FAIRCOM 



2606 Johnson Drive 
Columbia MO 65203 



The company that introduced micros to 
B+ Trees in 1979 and created ACCESS 
MANAGER 1 " for Digital Research, now 
redefines the market for high performance, 
B+ Tree based file handlers. With c-tree'" 
you get: 

• complete C source code written 
to K&R standards of portability 

• high level, multi-key ISAM routines 
and low level B+ Tree functions 

• routines that work with single-user 
and network systems 

• no royalties on application programs 



$395 COMPLETE 



Specify format: 
5'/<" PC-DOS V/i" Mac 
8" CP/M* 8" RT- 1 i 

for VISA, MC or COD orders, call 

1-314-445-6833 



Access Manager and CP/M are trademarks of Digital 
Research, Inc. 

e-tree and the circular disc logo are trademarks 
of FairCom 

<B 1984 FairCom 



CIRCLE 29 ON READER SERVICE CARD 




:<§ 



TOTAL CONTI 



FORTH: FOR Z-80@, 8086, 68000, and IBM® 

Complies with the New 83-Standard 

GRAPHICS* GAMES .COMMUNICATIONS •ROBOTICS 

DATA ACQUISITION • PROCESS CONTROL 



PC 



• FORTH programs are Instantly 
portable across the four most popular 
microprocessors. 

• FORTH is interactive and conver- 
sational, but 20 times faster than 
BASIC. 

• FORTH programs are highly struc- 
tured, modular, easy to maintain. 

• FORTH affords direct control over 
all interrupts, memory locations, and 
i/o ports. 

• FORTH allows full access to DOS 
files and functions. 

• FORTH application programs can 
be compiled into turnkey COM files 
and distributed with no license fee. 

• FORTH Cross Compilers are 
available for ROM'ed or disk based ap- 
plications on most microprocessors. 

Trademarks IBM, Internalional Business Machines 
Corp. CP/M. Digital Research Inc. POForih + and 
POGEN, Laboratory Microsystems, Inc 



FORTH Application Development Systems 

include interpreter/compiler with virtual memory 
management and multi-tasking, assembler, lull 
screen editor, decompiler, utilities and 200 page 
manual. Standard random access hies used lor 
screen storage, extensions provided for access to 
all operating system lunctions 
Z-80 FORTH lor CP/M" 2.2 or MP/M II, $100.00. 
8080 FORTH 'or CP M 2.2 or MP/M II. $100 00, 
8086 FORTH for CP/M-86 or MS-DOS, $100.00. 
PC/FORTH tor PC-DOS. CP/M-86. or CCPM, 
$10000: 68000 FORTH for CP/M-68K. S250.00 

FORTH + Systems are 32 bit implementations 
that allow creation of programs as large as 1 
megabyte. The entire memory address space ol 
the 68000 or 8086/88 is supported directly. 

PC FORTH + S250.00 

8086 FORTH + lorC=/M-86 or MS-DOS S250-00 
68000 FORTH + for CP/M-68K $400.00 

Extension Packages available include' soft- 
ware floating point cross compilers, INTEL 

8087 support. AMD 951 1 support, advanced col- 
or graphics, custom character sets, symbolic 
debugger, telecommunications, cross reference 
utility. B-tree file manager. Write lor brochure 




Laboratory Microsystems Incorporated 

Post Office Box 10430, Marina del fley, CA 90295 
Phone credit card orders to (273J 306-74T2 



CIRCLE 35 ON READER SERVICE CARD 



91 



which we would not hesitate to use in a 
large programming effort. The profes- 
sionalism presented is very apparent. 

One of the elements that seems to be 
missing, however, is effective support for 
program verification. Since the compiler 
produces p-code that is interpreted at one 
level in the development, one would 
believe that a very good symbolic 
debugger could be produced. In particu- 
lar, other languages are available from 
Alcor running the same p-codes, which 
would make the development of an inter- 
active debugging tool to go with its lan- 
guage packages quite attractive. 

The p-code implementation also allows 
for a large system development on a small 
machine. This may seem to be con- 
tradictory at first, but consider that the p- 



code, instruction for instruction, is much 
more dense than native machine code. So 
that once the program size has made up 
for the interpreter overhead, the p-code 
begins to be much more compact than the 
native code implementation. 

However, for small programs and util- 
ities, p-code loses big. Even with p-code 
conversion to native code, the native code 
compilers will win out. Interpreted 
languages— whether text-based or p- 
code-based— all have one failing: they 
bring one more level of complexity and 
potential for error into the picture. 

The p-code interpreter within the Alcor 
package is murderously slow. The Sieve 
benchmark took 3.3 min to run. We abor- 
ted Fib after 5 min. This seems to be 
about 10 times slower than most of the 
native code implementations. Even with a 
3-4 times improvement in speed of gener- 



A POWERFUL 68000 DEVELOPMENT 
ENVIRONMENT FOR YOUR Z80 SYSTEM 

C01668 ATTACHED RESOURCE PROCESSOR 



• 68000 Assembler 

• C Compiler 

• Forth 

• Fortran 77 




Pascal 

BASIC-PLUS 
CBASIC 
APL. 68000 



6 MHZ 68000 CP/M-6SK 768K RAM 

4 x 16081 MATH CO-PROCESSORS CPM80 RAM DISK 

Develop exciting 68000 applications on your current Z80 based CPM system using 
powerful mini-frame like 32 bit programming languages. And then, execute them at 
speeds that will shame many S100K plus minicomputer systems. 

The C01668 ATTACHED RESOURCE PROCESSOR offers a Z80 CPM system owner a 
very low cost and logical approach to 68000 development. You have already spent a 
small fortune on 8 bit diskette drives, terminals, printers, cards cages, power 
supplies, software, etc. The C01668 will allow you to enjoy the vastly more powerful 
68000 processing environment, while preserving that investment. 

C01668 ATTACHED RESOURCE PROCESSOR SPECIAL FEATURES: 



• 68000 running at 6 Mhz 

• 256K to 76SK RAM (user partitioned between 
CPU and RAM Disk usage) 

* Up to four 16081 math co-processors 

• Real time clock. 8 level interrupt controller 
& proprietory I/O bus 

* Available in tabletop cabinet 

* Delivered w/ sources . logics, & monolithic 
program development software 



• Easily installed on ANY ZS0 CPM system 

• CP/M-68K and DRPs new UNIX V7 compatible 
C compiler {w/ floating point math) - standard 
feature 

• Can be used as 76SK CPM30 RAM Disk 

• Opiional Memory parity 

• No programming, or hardware design required 
for installation 

• Optional 12 month warrantee 



• PRICES START AS LOW AS $899.00 for a C01668 with 256K RAM. CPM68K, C Compiler, Sources. 
Ptints, 200 page User Manual. Z80 Interface, and 63000 System Development Software. 



For further Information about this revolutionary product or our Intel 80S6 Co-Processor, please send Si 
[no checks please] or call; 



me 



Hallock Systems Company. I nc . 
262 East Main Street 
Frankfort. Ntui York 13340 
(315) 895-7426 



RESELLER AND OEM 

INQUIRIES INVITED. 



CIRCLE 31 ON READER SERVICE CARD 
92 COMPUTER tANGUAGEB FEBRUARY I985 



ated native code, it is running 2-3 times 
slower than the competition. 

Ecosoft's ECO-C 

Ecosoft proudly states that the only 
incompatibilities that its Eco-C has with 
the full C syntax are lack of bit fields and 
the Mine macro directive. The Eco-C 
package provides everything that is 
required to compile and run programs. In 
particular, it provides one of the best 
assemblers we have stumbled across, the 
SLR assembler by SLR Systems. The 
inclusion of tools of this quality does not 
dim the quality of Ecosoft's C imple- 
mentation but complements it. creating a 
very good program development tool. 

Eco-C is a very clean implementation 
of the C language. Portability of C pro- 
grams from other systems is very good. 
The SLR assembler selected as a compan- 
ion tool to the compiler is a breath of fresh 
air to the assembly language programmer. 

The manual for Eco-C is 1 15 pages 
long in an off-size format binder. For the 
large-scale project, you should see if you 
can order several manuals al extra cost. It 
is very concise and professionally done, 
concentrating on the essentials of oper- 
ating the compiler, creating libraries, the 
assembler interface, and Ecosoft's ver- 
sion of the standard library interface. The 
compiler docs not include any sources for 
the STDIO but docs state that Ecosoft will 
make them available for a simple copying 
charge and release statement. 

Included in the same binder is the man- 
ual for the SLR assembler. Approxi- 
mately the same length as the compiler 
manual, it quickly illustrates the use of the 
assembler, linker, and librarian included 
in the package. Just as an example, the 
assembler can be configured from the 
command line to output cither a .COM 
file, a .HEX file or one of two separate 
.REL file formats. We have not even dis- 
cussed how much faster it executes than 
M80. Too bad we are not reviewing 
assemblers! 

At $250, the Eco-C package is out of 
the range of most individual program- 
mers. Even so, with the inclusion of the 
SLR assembler for S45 extra, it is a good 
investment. The compiler and assembler 
are good for a large range of software 
development, from the small utility devel- 
opment effort to massive multi- 
programmer efforts. This is the only 
package we reviewed that we would be 
willing to call a professional tool. The 
compiler options, although not simple, 
were well-documented. The benchmarks 
were not the fastest but were in the ball- 
park, making this a fine tool for all- 
around use. 

The compiler is such a nice tool that it 
is too bad program verification interfaces 
consist entirely of using the .SYM output 
file al the assembly language level. There 
should be some way of hooking a sym- 
bolic debugger to the final program, 



cither as a compiler option to output 
restart instructions or hooks to allow for 
post processing the assembler output (i.e., 
output line numbers and line boundary 
markers as a compiler option). 

OS-9C COMPILERS 
Microware C 

Microware offers one of the few C com- 
pilers for the OS-9 operating system and 
the 6809 processor. That's not too much 
of a surprise because OS-9 is a Microware 
operating system. In case you haven't run 
into OS-9 before, it is a multi-user and 
multitasking operating system for the 
Motorola MC6809 8/16-bit micro- 
processor. OS-9 is blessed with UNIX- 
like tree directories and can support over 
1MB of system memory with memory 
management. It is therefore a very com- 
fortable environment for the C language. 

Though it is very close to a full C 
implementation. Microware C differs 
somewhat from K&R C. Bit fields arc not 
supported. Constant expressions for ini- 
tializers may include arithmetic operators 
only if the operands in the expression are 
of type int or char . The #if < constant 
expression > is not supported although 
ffifdef, ffijhdef. if else and ftendif are. 
Macro definitions and strings must reside 
on a single line of source code. Finally. 
the S n escape sequence is output as a car- 
riage return, which is not interpreted as an 
"end of line" character in most systems 
but is exactly what OS-9 requires. 

On the positive side, Microware has 
added some interesting enhancements. A 
new storage class. Direct, has been added 
to take advantage of the 6809's direct page 
register. Though use of this feature will 
make a program non-portable, it can be 
used when program execution speed has 
the highest priority. 

In addition, Microware's C supports in- 
line assembly code with the #asm and 
Mendasm preprocessor commands. It is 
possible to output a linefeed using the \ I 
line feed escape sequence extension. 

The Microware level II compiler com- 
prises six separate programs. An exe- 
cution manager, called CC2, is supplied 
as one of these programs. CC2 invokes 
the other five programs, simplifying the 
programmer's interface. The compilation 
sequence involves the preprocessor, com- 
piler, optimizer, assembler, and linker. 
Also included in the package is an exten- 
sive library of header files that facilitate 
operating system calls, a Microware 
BASIC09 interface, and several other use- 
ful functions. 

Intro! C 

Introl offers the other C compiler for the 
OS-9 operating system reviewed in this 
article. It is available for the Flex and 
Uniflex operating systems as well. Introl 
C is almost a full K&R implementation, 



lacking bit fields, double float variables 
and the Mine and ft/preprocessor 
directives. 

Introl's compiler has some enhance- 
ments. Comment nesting is permitted, 
allowing the programmer to comment out 
a section of code by bracketing the code 
segment. Separate name spaces for each 
union and structure are supported so that 
identical names can be used in different 
struct and union declarations. Symbols 
can be up to 90 characters in length. 

For $425 Introl supplies the compiler, a 
relocating assembler, linker, a library and 
a librarian. This comprises a nearly com- 
plete OS-9 language development system, 
lacking only an editor. For the hardware 
developer, a library of modules is avail- 
able for generating stand-alone, ROMable 
code. Introl's documentation is superb. 

One amenity Introl C lacks, however, is 



a module to invoke the various compiler 
phases automatically. With preprocessor, 
parse, code generation, optimizer, assem- 
bler and link phases all required to gener- 
ate an executable file, such a utility would 
be most welcome. Introl's C compiled 
more slowly than Microware's compiler 
and generated larger executable files. 
However, this is offset by the faster exe- 
cution times of Introl C's compiled 
programs. 

CP/M 86 C COMPILERS 

The last MS-DOS C compiler we 
reviewed is from Digital Research, which 
submitted both versions for review. It is 
similar to the CP/M 86 version, so we dis- 
cuss both in this section. 

CP/M 86 has not done well in the IBM 



Realia COBOL 
Numbers speak 
louder than words. 

Compilation Speed (minutesiseconds) 



Lines in 
Program 


Realia 
COBOL 


mbp 
COBOL 


Level II 
COBOL 


R-M 
COBOL 


Microsoft 
COBOL 


1,000 


:51 


8:33 


3:42 


5:05 


5:11 


5,000 


3:30 


48:07 


16:58 


* 


45:26 



"Could not successfully compile the program. 

Execution Time Ratio 

(Gibson Mix; calculated S-Profile) 



Realia 
COBOL 


mbp 
COBOL 


Level II 
COBOL 


R-M 
COBOL 


Microsoft 
COBOL 


1.0 


3.6 


14.7 


21.6 


22.3 



Sieve of Eratosthenes 



0.818 seconds per iteration 



All benchmark tests were performed on an 
IBM PC-XT with 192KB of memory. IBM 
PC-XT is a registered trademark of Inter- 
national Business Machines Corporation; 
mbp COBOL, of mbp Software and Sys- 
tem Technology; Level II COBOL, of Micro 
Focus; R-M COBOL, of Ryan-McFarland; 
and Microsoft COBOL, of Microsoft. 



+ IBM VS COBOL compatibility. 



REALIA 



$995 



10 South Riverside Plaza 
Chicago, Illinois 60606 
(312) 346-0642 



CIRCLE 76 ON READER SERVICE CARD 



93 



F77L, THE FORTRAN 

THAT CHALLENGES 

THE BIG SOFTWARE 

COMPANIES. 




When you have one software product to 
sell, you had belief make it count. F77L, our 
complete implementation of the ANSI 
FORTRAN 77 Standard for the IBM PC, is for 
programmers who buy a language system 
based on features and performance. 

By specializing in FORTRAN, we see 
ourselves as different from our competition. 
Rather than be jacks of all languages. LCS 
prefers to be experts in FORTRAN. O'jr 
competitors, on the other hand. lend to be 
large and ferocious software firms that offer 
computer users an assortment of products. 
At LCS. we specialize in FORTRAN. We have 
been successfully implementing FORTRAN 
language systems for over 15 years. We may 
not have the name recognition or the 
advertising buctgetsof the big firms, but we 
do have what matters most to you — a great 
product. 

Here are a few of the many reasons to buv 
F77L: 

• Full F ORTRAN 77 Language with popular extensions. 

• Compile time: multiples faster than any 
Goliaths'. ilOO's statements/min.) 

• User oriented interface. 

• Numerous, specific English level diagnostics 
displayed during compilation, 

• Command Line compiler options. 

• Execution error tracebark: program unit line 
number. 

• Selective protection lor constants, bounds, 
interfaces. 

• Standard or Free Formal source files. 

• Lattice C compatibility. 

• Easy to follow manual includes appendices 
on interfaces to Lattice C and Assembly 
language. 

• 30-day-money-back guarantee and ongoing 
user support. 

If you're tired of betting on the software 
Coliaths and losing, call LCS. the FORTRAN 
specialist. 

$477 for complete package: one 5V4" 
floppy and manual. Visa/MC Multiple copy 
discounts. "Requires: 256K/8087. 

To order or for more information: 

Lahey Computer Systems, Inc. 

904 Silver Spur Road, Suite 417 
Rolling Hi lis Estates. CA 90274 
213/541-1200 
Serving the FOR TRAN community since 7969 

IBM is a Ifddemjrk utf IBM corporation 

Latlue C *s a trademark of Lattice, Inc. 




PC segment of the 16-bit market but has 
fared better with the other computers 
using the 8086 processor. Since CP/M 86 
is a Digital Research operating system, it 
is of no surprise that the one CP/M 86 C 
compiler tested is also from Digital 
Research, though many of (he MS-DOS C 
compilers are also available in CP/M 86 
versions. 

Digital Research C 
We had a bit of trouble coaxing the CP/M 
86 version of Digital Research C to run on 
our IBM PC. This was probably not the 
compiler's fault. We had an old copy of 
CP/M 86 (version 1.0), and the compiler 
simply returned to the operating system 
before completing the compilation. Ver- 
sion 1 . 1 of CP/M 86 cleared this up, and 
wc were off and running. 

Digital Research C supports the small 
and big 8088 memory models. Memory 
model selection as well as 8087 support 
are specified at compile time by command 
line options. 

One very nice feature of the Digital 
Research C compiler documentation is the 
inclusion of a copy of K&R with the man- 
ual. Digital Research made it quite clear 
how to configure a working disk with 
compiler, linker, and library. We had no 
problem creating one. 

Source code was another story. Our 
benchmarks had all been written using a 
text editor under MS-DOS, and we had no 
editor for CP/M 86. Copies of CP/M 86 
compatible editors are few and far 
between in our area, and wc turned a bit 
green when we considered using the 
CP/M 86 editor ED to create the files. 
Fortunately we have a very handy utility 
program called Xenocopy Plus from Ver- 
tex Systems, which promptly transferred 
the four benchmark source files to a 
CP/M 86 disk. 

Sieve compiled and ran with no prob- 
lem. Fib required that we add ttindude 
<portab.h > so that the void typing 
would be recognized. Deref and Matrix 
also compiled and ran fine. 

An interesting aspect of the compilation 
is that the compiler places information in 
the object file so that the linker knows 
which libraries to use. No library parame- 
ters are in the link syntax. The compiler 
was not smart enough to place the object 
file on the same disk as the source file. It 
required we specify we wanted this by 
using the -z compiler option. However, 
the linker knew that we wanted the exe- 
cutable file on the same disk as the object 
file. Consistency once again is desirable 
but lacking. 

Digital Research also submitted for 
review the MS-DOS version of its C com- 
piler. Its benchmark performance is 
included in both the MS-DOS and CP/M 
86 benchmark tables for comparisons. 
Two very interesting conclusions are that 



Digital Research's compiler generates 
very fast code, consistently showing one 
of the best execution times in the 
MS-DOS category. 

The other point of note is that the 
MS-DOS version of the compiler gener- 
ates programs more quickly than the 
CP/M 86 version. Though not shown in 
the tables, we checked the times required 
to compile and link separately. The 
MS-DOS versions of both the compiler 
and linker are faster than their CP/M 86 
counterparts. We suspect that this is actu- 
ally better performance on the part of 
MS-DOS during floppy accesses. 

TRS-80C COMPILERS 

Three C compilers are available for the 
TRS-80 Z80 computers: LC, Alcor C, 
and Aztec C. Because other machine ver- 
sions of the Alcor and Aztec C compilers 
have already been covered, we will focus 
here on MiSosys's LC compiler. 

LC is based on Small-C and, like 
Small-C, is not a full implementation of 
the language. However, LC provides 
more of C's features than does Small-C. 
The switch and goto statements are 
included, greatly simplifying command 
parsers and similar routines. The omis- 
sions (floating point capability, long 
integers, unions , and structs) are signifi- 
cant only if you try to use it as a number 
cruncher. 

LC first appeared on the scene in 
December 1982 and has undergone only 
two significant changes since then. The 
first was a general bug-fix shortly after 
the package was released, which brought 
the version number to 1 . 1 ; the second 
actually did not affect the compiler but 
rather greatly extended the supplied 
libraries. This, the current version, is 1 .2. 
This review was done using version 1.1. 

When you buy LC (for SI 50), you get 
two disks (and a large 3-ring binder filled 
with an excellent user manual). One disk 
contains the LC compiler itself together 
with the libraries, an /ASM skeleton, and 
a /JCL file. The other contains EDAS, a 
full-featured macro assembler (which can 
also be purchased separately). The LC 
strategy is to compile the C source code 
into an assembly-language file, which is 
then assembled by EDAS. EDAS pro- 
duces executable code as its output; no 
linking step is required. 

On TRS-80 model 1 or 3 , LC programs 
require the LDOS operating system. No 
other DOS provides the capability for I/O 
redirection. On model 4, LC programs 
will run under all versions of TRSDOS 6. 
Incidentally, by using the appropriate 
/ASM skeleton and libraries, LC pro- 
grams can be cross compiled between 
models 1 , 3, and 4. Any model 1/3 LC 
program will run on cither model inter- 
changeably ; model 4 programs interface 
to the hardware differently but can be 
compiled by the model 3 compiler. 

The assembly-language output from LC 



CIRCLE 62 ON READER SERVICE CARD 
94 COMPUTER LANGUAGE! FEBRUARY 1985 



Scroll & Recall 

Screen and Keyboard Enhancement 

for the IBM - PC, XT and Compatibles 

Allows you to conveniently scroll 
back through data that has gone off 
the top of your display screen. 

Allows you to easily recall and edit 
your previously entered DOS com- 
mands and data lines. 

Very easy to use, fully documented. 
Compatible with ail versions of DOS, 
monochrome & graphic displays. 

$69 - Visa, M/C, Check, COD, POs 
Phone orders accepted 

Make Your Work Easier! 



To Order or to Receive Additional 

Information, Write or Call: 
Opt-Tech Data Processing 

P.O. Box 2167 • Humble, Texas 77347 
(713) 454-7428 
Dealer Inquiries Welcome 
-*— 

CIRCLE 67 ON READER SERVICE CARD 



/ SUPE^ORTH 64 "" ^^ 

TOTAL CONTROL OVER YOUR COMMODORE-64'" 
USING ONLY WORDS 

MAKING PROGRAMMING FAST, FUN AND EASY! 

MORE THAN JUST A LANGUAGE .. . 

A complete, lully-integrated program development tystem. 

Home Use, foil Gomel, Graphics, Data Acquisition, Business 

Red Time Process Control. Communications, Robotics, Scientific. Artificial Intelligence 

A Powerful Supenet ol MVPFORTH/ FORTH 79 * E»f. for the beginner or profeiiionol 

e SPRITE-EDITOR 

e Access oil C-64 peripherals including 4040 
drive 



e 20 to oOO X falter than Basic 

• 1/4 * Ihe programming time 
e Easy full control ol all sound , hi res. 

gra phics , color, sprite, plotting line & 
circle 

• Controllable SPLIT-SCREEN Display 

e Includes interactive interpreter & compiler 

• Forth virtual memor y 

• Full cursor Screen Editor 

• Provision lor application program 
diltribution without licensing 

• FORTH equivalent Kernal Routines 

• Conditional Macro Assembler 

• Meeft all Forth 79 standards* 

• Source screens provided 

e Compatible with the book "Storting Forth' 
by Lea Smote 

• Access to oil I/O ports RSI32. IEEE, 
including memory & mteinjptt 

e ROMABLE cade generaror 
» MUSICEDIfOB 

SUPER FORTH 64' » --■■ 

powfivl than m«l ofihfr (prnpuirf btiffL.OB»' J 
» SUFERFQRTH64 » 



• 5 ngle disk drive backup utility 

• Disk & Cassette bated. Disk included 

• Full disk uioge — 680 Sectors 

• Support* all ComTodore file typei and 
Forth Virtual disk 

• Access to 2Q< RAM underneath ROM 
a reai 

• Vectored kernel words 
t TRACE facility 

• DECOMPILER facility 

• Full Siring Handling 

• ASCII error meisagei 

■ FLOATING POINT WtlH SIN/COS A SORT 

• Conversational ui#f defined Command* 

• Tutorial eiamples provided, In extensive 
monuol 

• INTERRUPT routines provide easy control 
of hardware tirnen, alarms and devices 

• USER Support 

SUPER FORTH 64 «™,w «d. 

.-.c;; - ■-■■ m-or» compocf than **ei atttrr-bly cede! 



BASfC 
FORTRAN 
ASSEMBLER 




A SUPERIOR PRODUCT 

in ovary way! At a low 

price of only 

$96 



Power ol Languages Constliucts Program Functionality 

Call: 
(415) 651-3160 

PARSEC RESEARCH 

Drawer 1776, Fremont, CA 94533 ■ —; 

- unit ■( a* >; h i,,w„ <*n ChmMpim *j t vc-w H» «l Qtmmitm o> c o.d 



Tdkt Ih.i ad to (our k<a 

■Je-li *' <t' I D0h»>l sjook- 

iToit PKifjrii Wifin olw 



MicroMotion 

MasterFORTH 

It's here — the next generation 

of MicroMotion Forth. 



CIRCLE 49 ON READER SERVICE CARD 



• Available tor Ihe APPLE IPs, IBM PC, Macintosh & 
CP/M 2.x 

• Meets all provisions, extensions and experimental 
propose Is of the FORTH-63 1 nternational Standa rd , 

• Uses the host operating system . 

• Built-in micro-assembler with numeric local labels. 

• A full screen editor is provided which includes 16 x 
64 format, can push & pop more than one line, 
user definable controls, upper/lower case key- 
board entry. ACOPY utility moves screens withln& 
between lines, line stack, redefinable control 
keys, and search & replace commands. 

■ Includes all file primitives described in Kernigan 
and Plauqer's Software Tools. 

• The inputandoutputstreamsarefullyredirectable. 

• Theeditor.assemblerandscreencopyutilitiesare 
provided as relocatable object modules. They 
are brought into the dictionary on demand and 
may be released with a single command. 

• Many key nucleus commands are vectored. Error 
handling, number parsing, keyboard translation 
and so on can be redefined as needed by user 
programs. They are automatically returned to 
their previous definitions when the program is 
forgotten. 

• The string-handling package is the finest and 
most complete available. 

• A listing of the nucleus is provided as part of the 
documentation. 

• The language implementation exactly matches 
the one described in MASTERING FORTH , by Ander- 
son & Tracy. This 200 page tutorial and reference 
manual is included with MasterFORTH. 

• Floating Point & HIRES options available. 

• MasterFORTH - S100.00 APPLE & CP/M; S125.00 
Macintosh & IBM PC. Floating Point & HIRES - 
$40.00 each. 

• Publications 

• MASTERING FORTH - S18.00 

• 83 International Standard - $1 5.00 

• FORTH-83 Source Listing 6502,Z-80,8086 - S20.ea. 




Contact: 

MicroMotion 

12077 Wilshire Blvd.. Ste. 506 

Los Angeles, CA 90025 

(213) 821-4340 



CIRCLE 73 ON READER SERVICE CARD 



95 



can be modified or optimized as desired. 
No optimizer is included with the 
package. 

Data types handled by LC include char, 
inl, unsigned im, and pointers to any of 
these. Arrays are permitted but are lim- 
ited to only one dimension. Pointer arith- 
metic is in exact accord with K&R as are 
most of the library functions. The lack of 
floating point capability is addressed by a 
special library that provides interfaces to 
the floating point code in the TRS-80's 
ROM. This makes number crunching pos- 



sible, but such programs are not portable. 

Since LC is a subset, only the Sieve and 
integer-sort benchmarks are applicable to 
it. Table 5 (page 102) presents the results 
(measurements were made on an early- 
production model 4 operating in model 3 
mode at a clock speed of 2.2 MHz). 

The absence of structs looks to us to be 
only a minor inconvenience (the other 
omissions have posed no problems in my 
applications). Programs created with it 
include a virtual-memory full-screen edi- 
tor, a communications program including 
multiple file-transfer protocols, and many 



Dr. Dobbs says, 

WE HAVE 
GOOD NEWS 



• •• 



"WINDOWS FOR C can offer you a convenient, reliable means 
of implementing windows in your text handling programs 

•'..video output is fast and clean... 

"..documented in well-written and readable English... 

.has obviously been well thought out and very cleanly executed. 

"WINDOWS FOR C is a professionally-oriented set of 
programming tools. ..that we can recommend." 

— Ian Ashdown (Dr. Dobb's Journal, November 1984) 



MORE THAN A WINDOW DISPLAY SYSTEM, WINDOWS FOR C is 
a video toolkit for all screen management tasks: pop-up menus and 
help files, status line, keyboard interpreter, word wrap, auto scroll, 
highlighting, color control, overlay and restore, plus a library of over 
50 building block subroutines. 

EASY TO LEARN. EASY TO USE. Once you've tried WINDOWS 
FOR C, you'll wonder how you ever managed without it. 

Full support for IBM PC/XT/AT and compatibles, plus interfaces for non-IBM 
computers; Lattice C, CI-C86, Mark Wm. C, Aztec C, Microsoft C, DeSmet C 
(PC/MSDOS). 



The Good News . 



1 






- ■--! 


gi 



WINDOWS FOR G 

ADVANCED SCREEN MANAGEMENT MADE EASY 



A Professional Software Tool From 

CREATIVE SOLUTIONS • 802 . 848-7738 

2 1 Elm Ave., Box L2 • Richford , VT 05476 



WINDOWS FOR C (specify compiler and version) $ ! 95 
Demo disk and manual (applies toward purchase) 130 



MasterCard & Visa Accepted 

Shipping $250 

VT residents add 4"u tax 



small utilities. One of the best features of 
LC is the ease with which its libraries may 
be modified; possibly the poorest parts of 
it are the lack of optimization, the failure 
to perform constant expression evaluation 
at compile time, and the absence of 
parameterized tidefine commands. 

Whitesmiths footnote 

Unfortunately, we were not able to obtain 
for review a current version of the White- 
smiths C compiler. By the time you read 
this review. Whitesmiths should be ship- 
ping version 3.0. which claims to improve 
some of the problems wc encountered 
when we analyzed an older version (ver- 
sion 2.2) of the compiler. 

If you're considering the puchase of 
this older version of the Whitesmith 's 
compiler, you should be aware of the fol- 
lowing concerns: installation is poten- 
tially difficult because files are auto- 
matically erased during a relatively long 
link session. You'll need a hard disk to 
run the supplied DOS 2.0 batch files. 
Also, the two manuals supplied do not 
cover certain MS-DOS implementation 
issues very well (e.g., no installation pro- 
cedure for floppy-based systems running 
DOS 2.0 or 3.0), and the benchmarks 
used in this review had to be modified for 
them to compile correctly, due to the lack 
of automatic initializers. However, if you 
do cross development work with mini- 
computers and MS-DOS equipment, this 
version of Whitesmiths may be the right 
choice. 

That's it! 

A package is available for just about any 
requirement. Most of the packages are 
good, solid products. We have tried to 
point out the few that seemed less than 
adequate. Since everyone has different 
needs, it is difficult to make a hard 
recommendation. 

The C programming language con- 
tinues to evolve. Originating as a mini- 
computer systems programming lan- 
guage, it is now beginning to appear as a 
serious contender in the microcomputer 
arena. Is C a reality on microcomputers? 
The answer to that question is 
undoubtedly "Yes!" 



References 

1 . Clark. David D. "Two More Versions of C 
forCP/M."flrT£(May 1984): 246, 

2. Pournelle, Jerry. "A BASIC and Pascal 
Benchmark, Elegance, Apologies and 
FORTH." BYTE (Oct. 1982): 254. 

Authors Steve Leibson, Fred Pfahter, and 
Jim Reed can be reached ax CadnetLx 
Corp. , 5757 Central Ave. , Boulder, Colo. 
80301. 



CIRCLE 28 ON READER SERVICE CARD 



96 COMPUTER LANGUAGE! FEBRUARY 1985 



ADVANTAGE # 1 

At Programmer's Connection, we deliver the latest 
versions of products and keep you informed about 
upcoming "new releases" so that you can make 
the best purchasing decision. We care about the 
value you receive for your dollar, and that 
means getting the newest version of a 
product with the latest enhancements. 
When you are expecting a new release, 
Programmer's Connection delivers. 

Discover the advantages of buying 
from Programmer's Connection: 

1. We offer the latest version of a product. 

2. Most popular products are in stock ready to be shipped. 

3. Receive same manufacturer's support as if buying direct. 

4. Experienced professional programmers are on stall. 

5. Select from over 200 of the best software products available. 

6. Knowledgeable and courteous sales staff. 

7. Significant discounts off of retail prices 

8. No extra charge on prepaid orders, including major credit cards 

9. Reasonable charges for shipping and handling 
10. Toll free service from Canada and the Continental U.S. 




Programmer's Development Tools: 

Computer Innovations C-86 395 309 

DeSmet C Compiler with Debugger 159 145 

Lattice C Compiler 500 295 

Mark Williams C Compiler w/Source 

Debugger 500 449 

Wizard C 450 409 

Xenix Development System by SCO 1350 1099 

C Interpreter ■ RUN/C 

t way to learn the C language. In addit 
jse this system to develop and debug 
compilation. 



C UTILITIES: 



Phact by Phact Associates 395 359 

Windows For C by Creative Solutions 195 159 





OTHER UTILITIES: 



OTHER LANGUAGES: 



8088 Assembler w/Z-80 Translator 2500 AD . 100 89 

BetterBASIC by Summit Software Sale! 200 149 

Janus/ADA + Tools by R&R 700 499 

Modula-2/86 by Logitech 495 439 

Professional BASIC by Morgan Computing . 95 89 

STSC APL*Plus/PC 

New version 4.0 of this powerful APL development 
system is now available. Call us for product details. 

Sale price $469, List price $595. 



C UTILITIES: 



Btrieve by SoftCraft 250 194 

Communications Library by Greenleaf 160 124 

C Power Paks from Software Horizons CALL CALL 

C-Tree by Faircom 395 359 

C To dBase by Computer Innovations 150 139 

C Utility Library by Essential Software 149 119 

ESP for C by Bellesoft 349 319 

Graphic by Scientific Endeavors 195 169 

Greenleaf C Functions Library 175 129 

Halo Color Graphics 200 125 

CIRCLE 84 ON 



Dr. Halo by Lifeboat 95 79 

Periscope debugger by Data Base Decisions 295 269 

Pfix-86 Plus by Phoenix Software 395 299 

Plink-86 Overlay Linkage Editor 395 299 

Pmate text editor by Phoenix Software 225 159 

Polytron Products CALL CALL 

Profiler by DWB & Associates New Low Price! 125 99 

Screen Sculptor by Software Bottling 125 109 

CodeSmith-86 Symbolic Debugger 

by Visual Age 

The New Version 1.9 now supports In-Line Code Assembly. 
Save S26 off Manufacturers List Price of $145. 

Special Price $119 

Prices are subject to change without notice. 

Call for our Catalog consisting of 200 + 
Programmer's Development Tools Exclusively 
^^ , for IBM PC's and Compatibles, jmm>. 

-.~ij.'-~. . Account is charged when order is shipped. ^9 

In Canada: 

1-800-336-1166 1-800-225-1166 

Programmer's Connection 

136 Sunnyside Street 
Hartville, Ohio 44632 
(216)877-3781 (In Ohio) 
"Programmers Serving Programmers" 

READER SERVICE CARD 




Announcing a 

TOTAL PARSER GENERATOR 



<GQflL> :: = <nnPJD> < COMPILER > < DESIGN > 



SLICE YOUR COMPILER 
DEVELOPMENT TIME 

An LR{1) parser generator and several sample compilers, 
all in Pascal for your microcomputer. 

• Generates parser, lexical analyzer and skeleton 
semantics 

• Universal, error recovery system 

• Adaptable to other languages and computers 

• Interactive debugging support 

• Thorough documentation 

• TURBO PASCAL'" INCLUDED FREE OF CHARGE 

• Includes mini-Pascal compiler, assembler, simulator 
in SOURCE 



SPECIAL INTRODUCTORY OFFER S 995 



QPAR5ER'" rjns on IBM. PG'DOS ,n Turoo Pj«ai P*r*j?i -jrnroi&r n oCme, Form, a n «| S e m lource 
OPAFISEFItAki'saijia.Tiii^'andm-ngiaipja tvo'iiti como-wc fig-h-DeftamAnesicwTipim wtifi»kp!a. 
ion iem»nrics m P»cU soutcs Easy rn add 1 nil semanifcs r« YOUR afjrr.K.-tr.an Excellent !r_< indutlTrial 
»nd academic use An accompdnyinc Kntuoo* [SR6 f^isii"^; avfltlfHe in 1905 tramfig can M 
nrrangad Dernoniih. avotkaolo jfir S&0 

EducaliDnal arid quantity flisccunts avaiiarjfe Cr*c*. mcmey qrrjer. Uaslccaid. Visa CaliWn.a fes:- 

WRITE OR CALL FOP FREE BROCHURE 
Technical details: call J08/255-5574. immediate delivery Call TODAY' 

SYSTEMS, INC. 

H6J Hyde Ave. San Jose CA 95129 

TOLL FREE: 800-538-9787 

iCaJ.forrva i &sidenis call JOB/?55-5S7d} 
Turbo Pascal is a registered trademark dI Borland international 



CIRCLE 23 ON READER SERVICE CARD 



C Source Code 

RED 

Full Screen Text Editor 

IBM PC, Kaypro, CP/M 80 and CP/M 68K systems. 



■ RED is fas:! RED uses all of 
your terminal's special func- 
tions for best screen response, 
RLD handles files a; large as 
your disk automatically and 
quickly. 

• RED is easy to use for writers 
or programmers. RED's com- 
mands are in plain English. 

• RED comes with complete 
source code in standard C. 
RED has been ported to main- 
frames, minis and micros. 



• RED comes with a Reference 
Card and a Reference Manual 
thai provides everything you 
need to use RED immediately. 

• RED is unconditionally 
guaranteed. If Tor any reason 
you are not satisfied with RED 
your money will be refunded 
promptly. 

RED: S95 
Manual: $10 



edward k ream 



Call or write today for 

for more information: 

Edward K. Ream 

1850 Summit Avenue 

Madison, \VI 53705 

(«B) 231-2952 
To order: 

Hither tile UUS C compiler or the Aztec Cll compiler is required Tor OVM80 
systems. Dieilai Research C compiler s 1.1 is required for CP/M 6HK svstents. No 
compiler is required lor IBM or Kaypro systems. 

Specify both the machine desired (IBM. Kaypra or CP/M) and the disk format 
described 1 8 inch CP/M single density or exact type of 5'/j inch disk I. 
Send a check or money order lor S95 ($105 U.S. lor foreign orders). Sorrv. I do 
NOT accept phone, credit card, or COD orders. Please do nol send purchase orders 
unless a check is included. Votir order will be mailed lo you within one neck. 

Dealer inquiries invited. 



Ulhat bJsb cnuld uou do P If you had s 
3-D GRAPHICS LFilUGUnEE to harness the 
camputat isna I pourer af idour cnmputEr? 




E.G. is b new programming language that 
provides mast or the computing pntuer of 
a dedicated CFiD 5Y5TEm at en incredible 
pricei less than one cent an the dollar 



EdB.is a complete graphics language: 
J automate the generation of drawings 
j design math intansivE products 

* unurap S. template curved surfaces 

* output ascti files to drive n.c.tnals 

* accuracy exceeds 1 part in 35, BBB 

43 cDmronds control leaping, branching 
disc access, internal data structures, 
suttrcjut ines and output devices. 



E.G. is also a poujerFul past-processor: 

-r- plat your numerical data in 3-D 

J virtually unlimited macro capability 

* T J e7J,l E J "turn-key" applications 

* 10BB data paints, 1BB0 lines per file 

* optional "best fit" plot algorithm 



Easy to use, rather than easy to learn 



E.E.providEs the programmer ujith every 
niathemat lea I aperat Ian £. Funct inn Found 
n emii i C + pmuerFul, proprietary shape 
generating and manipulating commands . 



_,,_„ EUCLID GRAPHICS 

BVSIEms developed at mnmuFiL $ E5 

E4K APPLE SE^EN 5EFI5 SDFTlunRE CDuTpCete SEBC 



D.FJ.5 3.3 35 Cape George Wye 
Part Taiuensend. Da, 
98363 
<£06> 385-3771 



Free updates 
For one year 



signed nondisclosure agreement required 



CIRCLE 4 ON READER SERVICE CARD 



BUFFEHED i/O BOARD Introductory Price 'S59.95 

Withdespool [unctions, protocols supported: XONIXOFF, ETX: ETBIACK 



£> 



Ml. 



tt t IM 



Serial 110 
110.19200 Baud 



HI 



Serial I tO 
110-19200 Baud 



I < B r> 



Parallel 
In 



<£>j 



Parallel 
Out 



Programmable . 
Timer 



ZB0 Conlrql 
Processor 



B4K 

Bultei RAM 






Vectored 
Interrupts 



, S-100 Interface 
16 Bit I/O Addressing 



TT 



2K Program EPROM 

Programmable Functions; 
Dynamic Buttering 



BO CHARACTER VIDEO BOARD 

25 Lines with slatus, compatible with Wordstar & dBase 



* $49.50 



C> 



+ 44 




1 * T <"> 


Sep, 
Sync. 




Composite 
Video 




2716 Char. 
Gflneratot 
EPROM 


2716 Allemale 
Character 
Gen. EPROM 


Bell 

Out 




Keyooarc 

Parallel 

Port 




t 




1 1— 




- 1 ' r 




i 




B275 CRTC 
Reverse Video 
Highlight, Blink 




ZS0 Control 
Processor 


- 


Type Ahead 
Bulfer 












t L 










' 






, i 




Screen 
RAM 


2K Program 
EPROM 


S-1G0 Interlace 
fi Bit I/O 
Addressing 




Memory 
Mapped Iro 




_ 


r 





























Includes Bareboard, Healsink & Documentation Call or write for more intormation, 

P.O. S*x60t KIP 

!♦#«&*. U. 60195 aMi 
(3iZ) 359-7337 

OEM dealer pricing available. $3.00 S/H. it. Res. add 7% tax l^ff ^~^ 

davta" - al Aihtrsn - r.l* Curp. — Wordstar" - al Miciapro Im'i. Ctiwp ^^^p 

CIRCLE 70 ON READER SERVICE CARD 



98 



COMPUTER LANGUAGE ■ FEBRUARY 19B5 



Basic data types 




Lattice 



yes no 



yes yes 



yes no 



yes no 



yes yes yes 



no yes yes yes yes yes 



Microsoft yes no 
(2.03) 



yes yes 



yes no 



yes no 



Microsoft yes yes yes yes 

(3.0) 



Mark yes yes 

Williams 



yes yes 



= Systems 



? Supersofl yes yes yes yes yes no no no no no yes 



C Ware yes no yes yes no no 



yes no 



yes yes yes 



Datalight 


yes 


no 


yes no 


no 


no 


no 


no 


Ecosoft 


yes 


yes 


yes yes 


yes 


yes 


yes 


yes 



no no 



yes no no no 



no 



Ale 



yes yes 



yes yes 



BDS 



yes yes 



yes yes 



yes yes 



Code yes yes 

Works 



yes yes 



yes yes 



no no 



Software yes yes yes yes 

Toolworks 



yes 



yes yes 



Hendrix yes no 



yes no 



no no 



no no 



no no 



no no no no 



Micro ware yes yes yes yes yes yes yes yes yes yes yes 



Introl yes (default) yes yes yes yes yes yes yes no yes no 

(unsigned) 



yes yes yes no no yes yes yes yes yes 



yes yes yes yes yes yes yes yes yes yes yes yes yes yes 



yes yes yes yes yes yes yes yes yes yes yes yes yes yes 



5. Rational yes yes yes yes yes yes yes yes yes yes yes no yes yes yes yes no yes 



■5 Wizard yes yes yes yes yes yes yes yes yes yes yes yes yes yes yes yes yes yes 

^ Systems 



{ Computer yes yes yes yes yes yes yes yes yes yes yes no no yes yes yes no yes 

t Innovations 



yes yes no yes no yes 



£ Manx yes yes yes no yes no yes no yes yes yes no no yes yes yes no yes 

Software 
Systems 



C-Systems yes no yes yes yes no yes no yes yes yes no no yes yes yes yes yes 



yes yes yes yes no yes 



g Digital yes yes 

S Research 



yes yes 



yes yes 



yes yes 



yes yes 



yes yes yes yes 



no yes 



yes yes yes yes yes yes yes yes yes yes 
yes yes yes yes yes yes yes yes yes yes yes yes yes yes 



yes yes yes yes yes yes yes yes 



no no yes yes yes yes yes yes no yes 



yes no yes yes yes yes yes yes yes yes 



no no 



yes yes yes no yes 



yes yes yes no yes 



yes 



"One dimensional. ** Is a library function. 

Table 3. 



99 



Library functions 






Lattice 


yes 


yes 




Microsoft 2.0 


yes 


yes 




Microsoft 3.0 


yes 


yes 




Mark Williams 


yes 


yes 


"5. 


Rational 


yes 


yes 


E 
° 


Systems 






</l 


Wizard 


yes 


yes 


O 


Systems 






9 








u 


Computer 


yes 


yes 


a. 


Innovations 






O 


Supersoft 


yes 


yes 


9 


Manx Software 


yes 


yes 


s 


Systems 








C-Syslems 


yes 


yes 




CWare 


yes 


yes 




Dalolight 


yes 


yes 




Ecosoft 


yes 


yes 


k. 

'5. 


Aleor 


yes 


yes 


BDS 


yes 


yes 


E 




Code Works 


yes 


yes 


S 


Software 


yes 


yes 


Si 


Toolworks 






u 


ftertdrix 


yes 


yes 


t> 


Microware 


yes 


yes 


to 








o 


Introl 


yes 


yes 


-o 


Digital 


yes 


yes 


CO 


Research 






s 








S; 








u 









yes 
yes 
yes 
yes 
yes 

yes 

yes 

yes 
yes 

yes 
yes 
yes 
yes 
yes 
yes 
yes 
yes 

yes 
yes 
yes 
yes 



yes 
yes 
yes 
yes 
yes 

yes 

yes 

yes 
yes 

yes 
yes 
yes 
yes 
yes 
yes 
yes 
yes 

yes 
yes 
yes 

yes 



yes 
yes 
yes 
yes 
yes 

yes 

yes 

yes 

yes 

yes 
yes 
yes 
yes 
yes 
yes 
yes 
yes 

yes 
yes 
yes 
yes 



yes 
yes 
yes 
yes 

no 

yes 

yes 

no 
yes 

yes 
yes 

no 

yes 

no 

no 

no 

no 

no 
yes 
no 
yes 



yes 


no 


yes 


yes 


no 


yes 


yes 


yes 


no 


no 


yes 


yes 


yes 


yes 


no 


yes 


no 


yes 


yes 


no 


no 


yes 


yes 


no 


no 


yes 


yes 


yes 


yes 


yes 


yes 


no 


yes 


yes 


yes 


yes 


no 


yes 


yes 


yes 


yes 


no 


yes 


yes 


no 


yes 


yes 


yes 


yes 


no 


yes 


yes 


yes 


yes 


no 


no 


no 


no 


no 


yes 


yes 


yes 


yes 


yes 


S10 


yes 


no 


yes 


yes 


yes 


yes 


no 


yes 


external 


yes 


yes 


no 


yes 


no 


yes 


yes 


no 


yes 


yes 


yes 


yes 


no 


yes 


no 


yes 


yes 


yes 


yes 


no 


no 


yes 


yes 


? 


no 


no 


yes 


no 


no 


yes 


no 



Table 4. 



100 



COMPUTER LANGUAGE ■ f EBRUARY 1985 



C ENGLISH. 

The C Generation Language. 



WhatiscENGUSH?cENGLISH is a comprehensive fourth generation 
procedural language based on dBASE IP syntax, it is portable to a 
wide range of micros and minis. The language features user-trans- 
parent interfaces to a wide range of popular C compilers, operating 
systems, and data base managers. 

How is portability achieved? cENGLISH through its compiler inter- 
face translates cENGLISH into documented C source and uses a host 
C compiler to produce native machine code. 



CfNGUSH 
SOURCE 




EXECUTABLE 

NATM 

MACHINE COOE 












• 


V 






C 








> 




SOURCf 









Csourca can bo 9mtMdd4ti IncEHGL&H sourcs. 

Differences in the operating system and data base manager are 
handled by the runtime libraries. 

The result is that cENGLISH source can be compiled without modi- 
fication on any micro or mini configuration supporting cENGLISH. 
What about performance? cENGLISH executes FAST, just like any 
compiled C program. 

How easy is cENGLISH to use? While cENGLISH is a powerful high 
level language that can accommodate complex software develop- 
ment, it remains simple and straightforward to use. 

Call or write for availability of c ENGLISH for the following configu- 
rations- 
Compilers: 

Standard O/S compilers: Lattice C" for MS/DOS'" 
Operating Systems: 

UNIxf UNIX-like, MS/DOS: Coherent: VMS" 
Data Base Managers: 

C-ISAM" and INFORMIX: UNIFY," ORACLE: PHACT Logix" 
Foreign Language Versions: 

German, French, Spanish 

Atterrfion MS/DOS users. Demo version and special introductory offer 
available for IBM PC: XT,' AT," and other MS/DOS systems. 
Requirements: 256K. hard disk or two floppy disk drives, and 
MS/DOS 2.1 or higher. 

Attention dBASE II and dBASE III users. dBASE II to cENGLISH 
Converter now available; dBASE 111 Converter available later this 
quarter. Converted code is portable to micros or minis and executes 
as fast as original cENGLISH source. 

l&DOStiaTOWT«*o»Mcf3Krt IncCcrtfirPnotTaawrortrfMcrtWllnrrearrparT, ^VSr*o?TjdencnofDs|t3l£juiprwn! 
CapMwn C^SAMaroWWWUMfiwimorWtf 6#cwa0awtiiB»$ni«Ta JK OocrtsonacwartaOrKMlnc FMAC1 

q S tTOC*TO* 0< RXJCt AMOOOHS I 0C« * P»OC*KJft <* LO0«l SO«W» »X *W PC XT d*3 H m tTM«mc«1UC«lnWnono<K* 
BknKMUMQcrrosCwpoarwn IMPf n a HdHnodl oUMV tap 



SAMPLE cENGLISH PROGRAM 

IDENTIFICATIONS 

MODULE Mmirro™ 

AUTHOR DCs 

DATE 8/29/64 

REMARKS SamptecENGLISH program thai odds lirst 
names 'a o f ile 
END IDENTIFICATIONS 



GLOBALS 

FIXED LENGTH Ions 

FIXED LENGTH 15 fnome 
END GLOBALS 

MAIN PROGRAM 

BEGIN 
CLEAR SCREEN 
SET ECHO OFF 

USE ■NAMES" 

VIEW BY TD_FNAME " ASCENDING 

AT 23,1 SAY' Add record? Yor N" 
AT 23.25 ENTER ons USING "' ' 

WHILE onsEO'V 
CLEAR GETS 

AT 6. 1 SAY "Enter first name" 
AT 6.20 GET Fnome 
READ SCREEN 

INSERT 

Frame = Frame 
END INSERT 

AT 12, 1 SAY Welcome to cENGLISH; & Fnome 

WAIT 

AT 14, 10 SAY "HIT ANY KEYTO CONTINUE" 

STORE" "TO Fnome 

STORE" "TOons 

AT 23. 1 SAY "Add onolhet record'' ¥ or N" 

AT 23.30 ENTER ons USING" 1 ' 

CLEAR ROW 1THRU 23 

END WHILE 

AT 1 2, 10 SAY "That's oil lor raw'" 
UNUSE "NAMES " 
SET ECHO ON 

END PROGRAM 



f 



** M Hklt 



I'd like to know more about cENGLISH. 
Please send further information. 


ftwTNiime 


Til If 


Company 


"■ ■ r " ■ 


Addrew 



Ciry 
Check one: 



Suit 
1 Dealer 



Syiiem House 
. .TCit Ontario, Chicago, IL 
Tetex 510315 Phone (3 1 2| 9444MG 



] Distributor 



L 



]r i in^a cUNFi Canada, Inc. Complete La Laurendenne, 
"i5 r _ 



42 5 St. Amable, Suite 1 65, Quebec, Canada G 1 R5E4 
Phone |416| 524 4641 



:,(JanadalilK5t4 

A4QS4 I 



CIRCLE 26 ON READER SERVICE CARD 



101 



TRS-80 benchmark comparisons 



Source code size (bytes) 
Assembly code size (bytes) 
Executable code size (bytes) 

Compile time (min:sec) 
Assembly time (min:sec)' 

Execution time (min:sec) 2 



Sieve 

390 
2,768 
3,129 

00:28 
02:53 

01:52 



Mysort 

296 
2,750 

3,139 

00:28 
02:59 

00:32 



1 . EDAS is disk bound when compiling LC-generated code; these times reflect perfor- 
mance of a two-pass assembler taking all input from floppy disk files. 

2. Times include total program load and run time. Actual sorting time on mysart was 
about 9 sec; remaining time includes array initialization and results reporting. 

TableS. 



The C Interpreter: 

nstant-C 



Programming in C has never been Faster. 
Learning C will never be Easier, 

Instant-C " is an optimizing interpreter for the C language that can make 
programming in C three or more times faster than using old-fashioned 
compilers and loaders. The interpreter environment makes C as easy to 
use and learn as Basic. Yet lnstant-C m is 20 to 50 times faster than inter- 
preted Basic. This new interactive development environment gives you: 

Instant Editing. The full-screen editor is built into Instant-C™ for imme- 
diate use. You don't wait for a separate editor program to start up. 
Instant Error Correction. You can check syntax in the editor Each error 
message is displayed on the screen with the cursor set to the trouble 
spot, ready for your correction. Errors are reported clearly, by the editor, 
and only one at a time. 

Instant Execution. Instant-C ''' uses no assembler or loader. You can 
execute your program as soon as you finish editing. 

Instant Testing. You can immediately execute any C statement or func- 
tion, set variables, or evaluate expressions. Your results are displayed 
automatically. 

Instant Symbolic Debugging. Watch execution by single statement 
stepping. Debugging features are built-in; you don't need to recompile or 
reload using special options. 

Instant Loading, Directly generates .EXE or .CMD files at your request 

to create stand-alone versions of your programs. 

Instant Floating Point. Uses 8087" co-processor if present. 

Instant Compatibility. Follows K & R standards. Comprehensive stand- 
ard library provided, with source code. 

Instant Satisfaction. Get more done, faster, with better results. 
Instant-C™ is available now, and works under PC-DOS, MS-DOS* and 
CP/M-86*. 

Find out how Instant-C™ is changing the way that programming is done. 
Instant-C™ is $500. Call or write for more information. 

Rational (617)6535194 

AvauvjAiai pQ Box 480 

Systems, Inc. Natick, Mass. 01760 

Trademarks: MS-DOS (Mcrosott Corp.), B087 (Inteil Corp ), CP/M-86 (Digiial Research. Inc ), Insant-C (Rational Systems, Inq ) 



Manufacturer Product 

Alcor AkorC 

1 1 32 Commerce 
Richardson, Texas 7508 1 
(214)238-8554 

BD Software BDSC 

P.O. Box 2368 
Cambridge, Mass. 02238 
(617)576-3828 

C-Systems C 

P.O. Box 3253 
Fullerton, Calif. 92634 
(714) 637-5362 

CWare DeSmelC 

P.O. Box C 

Sunnyvale, Calif. 94087 

(408) 720-9696 

The Code Works Q/C 

Box 6905 

Santa Barbara, Calif. 93 1 60 

(805)683-1585 

Computer Innovations Optimizing C86 

980 Shrewsbury Ave. 
Tinton Falls, NJ. 07724 
(201)542-5920 

Datalight Small-C 

1 1557 8th Ave. N.E. 
Seattle, Wash. 98125 
(206)367.1803 

Digital Research C 

60 Garden Cl. Rd. 
P.O. BoxDRI 
Monterey, Calif. 93942 
(408) 646-6464 

Ecosoft Eco-C 

6413 N. College Ave. 
Indianaplolis, Ind. 46220 
(317)255-6476 

Jim E. Hendrix Small-C 

P.O. Box 8378 
University, Miss. 38677 
(601) 234-7508 eves. 

Introl C 

647 W. Virginia St. 
Milwaukee, Wis. 53204 
(414)276-2937 

Lattice C 

P.O. Box 3072 

Glen Ellyn, III. 60138 
(312)858-7950 

Manx Software Systems Aztec C 

P.O. Box 51 

Shrewsbury, N.J. 07701 
(800)221-0440 

Mark Williams Co. MWC86 

1 430 W. Wrightwood Ave. 
Chicago, III. 60614 
(800)692-1700 

Microsoft C 

P.O. Box 97200 
Bellvue, Wash. 98009 
(206) 828-8039 

MiSosys Inc. 

P.O. Box 239 

Sterling, Va. 22170-0239 

(703)450-4181 

Rational Systems Instant C 

P.O. Box 480 
Natick, Mass. 01 760 
(617|653-6194 

Software Toolworks C/80 

1 5233 Ventura Blvd. Ste. 1118 
Sherman Oaks, Calif. 91 403 
1818)986-4885 

Supersoft C 

P.O. Box 1628 
Champaign, 111.61820 
(217)359-2112 



CIRCLE 56 ON READER SERVICE CARD 

102 COMPUTER LANGUAGE ■ FEBRUARY 1985 



Wizard Systems 
11 Willow Ct. 
Arlington, Mass. 02174 
(617)641-2379 



Wizard C 



STRUCTURE FOR BASIC 

u . . . PROFESS! ONAL PROGRAMMI NO 
ENVIRONMENT 



_~ 



ELIMINATES 

LINE 

NUMBERS 

ALLOWS 
MULT! -LINE 
CONDITIONALS 

PCDOS/MSCOS 



WORKS WITH 

BASICS 

1 NTER FRETEfi 

COM PI LXR 

FULL ERROR 
LOGGING 

PROGRAM 
U STER 



1 BENDORF 



i206 S. MAIN 

p.o. box 5sia 

ROSWELL, NM 

S8201 
505 347-5701 

UISA/MASTERCARD 



LABELED 

PROCEDURES 

MACROS 

SUB-ROUTINES 

LIBRARIES 




Users' 
Group 



Over 40 volumes of public 
domain software including: 

• compilers 

• editors 

• text formatters 

• communications 

packages 

• many UNIX-like tools 

Write or call for more details 
The C Users' Group 

415 E. Euclid* Box 97 

McPherson, KS 67460 

1316)241-1065 



A general purpose programming 
language for string and list 
processing and all forms of 

non-numerical compulation. 

SNOBOL4+ -The entire 
SNOBOL4 language with its superb pattern-matching 
facil ities • Strings over 32.000 bytes in length • Integer 
and floating point using 8087 of supplied emulator *rA 
■ ASCII, binary, sequential and rondom- 
access I 'O • Assembly Language inter- j(r 




to 300K bytes js^* 4 J 

bam «*r\ t\A VJ 



grams and functions 



.g. T _ 



Forall8086 66 PC MS-DOS or 

CP M-36 systems. 12BK minimum 

D5DD specify DOS CFM formal 



t 



Send check VISA. M'Cto: 

'°Catspaw, Inc. 

P.O.Box 1123-Salido. CO81301 



$95 

plus'3s/h 
'303 53 1 * 3BBJ 



CIRCLE 10 ON READER SERVICE CARD 



CIRCLE 43 ON READER SERVICE CARD 



CIRCLE 9 ON READER SERVICE CARD 



s 


* * * EASY TO USE # * * 
Macro Programs for 


■ 

4 


H^^^fflf I 


1 1' 


NOW tor PC-DOS 


::• 


i i 

# i ■* 
i * 


Customized Tiblv* -RAMd Ilk with .BAT II la. 

Toggle extended character iet and prinipr 
control. 




i *■ 

# t 
i h 


Our old standby, DearJohn, mailing Hal 
management v»tth u us lilts. Sill! $$7,50 CP/ M or 
PC-DOS 


" 4 


i •* 

• :» 

: i 


"NEW* All You Wanted lo know abour 
Spellbinder but Couldn't Find Out". A 
programmer 1 ! notebook of major command* 
and how to use. $10.00 pef copy 


;;• 




We have a Iqng Hit qI CJUflflfll mpcroi lor me In 
the office and by the programmer. Send tl .00 
for catalog. 


;;'• 


• » 


<«0mPUTEn RESOURCES _. 


" * 


lj» 


P.O. Box 1569 Kamuela, Hawaii 96743 
[808} 885-7905 


isj 



ADVERTISE 

in the April issue of 

COMPUTER 
LANGUAGE 

Special distribution 

at the 

West Coast 

Computer Faire 

Reservation deadline: 

February 6th 
Call (415) 957 9353 



BDSCv1.5 

For FAST 
Development 

• Fastest compile to execute 
cycle of any CP/M 80® 
Compiler. 

• Dynamic 
debugger, 

• 180 page 
manual. 

TERMS: check, c.o.d., charge card. T 

{316)431-0018 



© 



KS res. add 4% tax. 


$120.00 


Plus $2.50 


Shipping 6 handling 




Dedicated Micro Systems Inc 



P.O. Box 481 Chanute, KS 66720 o 



CIRCLE 14 ON READER SERVICE CARD 



CIRCLE 21 ON READER SERVICE CARD 



c Programmers 

B-Trees 



For 



75. 



OO 

1+2.00 Postage 

source code included 

The Softfocus B-Trees record index- 
ing library will help you develop 
sophisticated application programs. 
With Softfocus B-Trees you get: 

• high speed file handling for up 
to 16.7 million records per file 

• customizable BDS or K & R 
standard C source code 

• no royalties on applications 
programs 

• support random and sequential 
file access 

• includes example programs 

« Softfocus 
1277 Pallatine Dr.. Oakville. ont. 
Canada L6H 1Z1 (4161 844-2610 i 



CIRCLE 79 ON READER SERVICE CARD 



Com pu Pro 
Users Group 

Over 700 Members 
and Growing! 

Join now to receive: 

- Technical Newsletter 

- Bulletin Board & RCPM 

- Software Reviews 

- New Product Announcements 

- Hardware Help 

- And More! 

All for just $24/year! 

Send check to: 

C-PRO Users Group 

P.O. Box 2146 
Woodbridge, VA 22193 



CIRCLE 61 ON READER SERVICE CARD 



-+ All l&JbS. DftlA PHODOCTS ■ *> 
IS-Blt. s-ioo But: Systomu & Boards 

• * « FIREBALL DISCOUffTS - ' - 

25% off List Price (UPS extra) tor 

Cashlefs Check or Money Order 

+ + + 

You save MONEY = We save TIME 

♦ + + 

See -+ LOMAS 4- ad In bvte 

or request complete specifications 

\ UBHTNING SPEED / 
8028B-CPU a B02B7-NOP: <tr<68. 75 
; I THUNDERING PERFORMANCE I I 

aoiee & i/o a 256K-dram * 5.25-/8- 
disk controller 4 CCP/M-86: $1I»6.2B 



Configured for SmnTuc-STOO printer: 

T»H>Vid9O-GA970C VOT: $1121.75 

Spellbind f -5. 30 W/P: $371.26 

HIERATIC COMPUTE* SYSTEMS 

■OX 133l MEDFOKD. I-IA 03155 

[6171 683-6540 



CIRCLE 45 ON READER SERVICE CARD 



103 



ADVERTISER INDEX 



Alcor Systems. . 
Amber Systems. 
BD Software .. . 



PAGE 

NO. 

12 

4 
42 



CIRCLE 
NO. 

... 1 
... 2 
... 3 



Bendorf & Associates 1 03 10 

Blaise Computing Inc 83 11 

Borland International 6,7 6 

Business Utility Software 86 17 

C Journal 86 5 

C Systems 59 16 

C Users Group 1 03 43 

CWare 38 18 

C-Linelnc 101 26 

C Pro Newsletter 103 61 

Catspaw Inc 103 9 

Code Works (The) 24 42 

CompuPro COVER IV 12 

CompuServe 2 7 

Computer Innovations 41 8 

Computer Resources of Waimea 1 03 14 

Computingl 74 37 

Compuview Products 81 40 

Creative Solutions 96 28 

DWB Associates 23 20 

Data Base Decisions 47 30 

Datalight 24 19 

David Smith Software Co 90 36 

Dedicated Micro Systems Inc 103 21 

Ecosoft 90 22 

Essential Software Inc 32 27 



(LISP) FOR A.I. 

UO-LISP Programming Environment 

The Powerful Implementation of LISP 

for MICRO COMPUTERS 




LEARN LISP System (LLS.l) 
(see description below €39 95 

UO-LISP Programming Environment 
Base Line System (BLS.l) $49.95 



Includes: Interpreter, Compiler, 

Structure Editor, Extended Numbers, 

Trace, Pretty Print, various Utilities, 

and Manual with Usage Examples. 

(BLS.l) expands to support full system 

and products described below. 



UO-LISP Programming Environment: The Usual LISP Interpreter Functions, 
Data Types and Extensions. Structure & Screen Editors. Compiler, Optimizer, L1SP& 
Assembly Code Intermixing, Compiled Code Library Loader, I/O Support. Macros, 
Debug Tools, Sort & Merge, On-Une Help. Other Utility Packages. Hardware and 
Operating System Access. Session Freeze and Restart. Manual with Examptesexpands to 
over 350 pages. Other UG LISP products include: LISPTEX text formatter, LITTLE 
META translator writing system, RL1SP high level language, NLARGE algebra system. 
Prices vary with configurations beyond (BLS.II please send /or FREE catalog. 
LEARN LISP System (LLS.l): Complete with LISP Tutorial Guide, Editor Tutorial 
Guide, System Manual with Examples, Full LISP Interpreter, On-Line Help and other 
Utilities. LEARN LISP fundamentals and programming tec hniques rapidly and effectively. 
This system does riot permit expansion to include the compiler and other products listed 
above, 

LISP Tutorial Support (LTS.l): Includes LISP and Structure Editor Tutonal 
Guides. On line Help, and History Loop. This option adds a valuable learning too! to the 
UO-USP Programming Environment (BLS.]| Order (LTS.l) for $19.95. 
REQUIRES: UO LISP Products run on most Z80 computers with CR'M, TRSDOS or 
TRSDOS compatible operating systems. The 8086 version available soon. 
TO ORDER: Send Name. Address. Phone No , Computer Type. Disk Format Type. Package 
Pnce, 6.5% Tax (CA residents only). Ship & Handle fee of 53.00 inside US. & CN, S10 outside 
U.S., Check, Money Order, VISA and MasterCard accepted. With Credit Card include exp. date. 
Other configurations and products are ordered thru our FREE catalog. 

Northwest Computer Algorithms 

P.O. Box 90995, Long Beach, CA 90809 (213) 4261893 



FairCom 91 

Greenleaf Software 88 

HSC, Inc 92 

Harvard Softworks 85 

Haventree Software 12 

Hieratic Computer Systems 1 03 

Intro! Corp 62 

Korsmeyer Electronics Design 78 34 



.29 

.44 
31 
47 

.41 
.45 
.32 



Laboratory Microsystems Inc 91 

Lahey Computer Systems Inc 94 

Lattice Inc 64 

Lifeboat Associates 52,53 

Lomas Data Products 25 

mbp Software & Systems Technology .... 10 

MEF Environmental 89 

MEF Environmental 86 

Manx Software Systems 8 

Megamax, Inc 70 

Mendocino Software Co. Inc 70 

Micro Methods 70 

Micromotion 95 

MicroTec Research Inc 76 

MicroWay 72 

Mindbank Inc 22 

Next Generation Systems 66 

Northwest Computer Algorythms 104 

Oasys 63 

Oasys 65 

Opt-Tech Data Processing 86 

Opt-Tech Data Processing 95 

Parsec Research 95 

Phoenix Computer Products Corp 48 

Plum Hall 67 

Poor Person Software 58 

Prentice Hall 16 

ProCode 85 

Programmer's Connection 97 

Programmer's Shop (The) 60 

QCAD 98 

RR Software COVER II . 

Rational Systems, Inc 1 02 

Realia, Inc 93 

Reom, Edward 98 

SLR Systems 72 

Seven Seas 98 

Shaw American Technologies 58 



Simpliway Products Co. 

Soft Advances 

Soft Craft Inc 

Softfocus 

Software Horizons 

Solution Systems 

Solution Systems 

Solution Systems 



98 

85 

77 

1 03 

84 

60 

60 

60 

Spruce Technology Corp 87 

68 



.35 

.62 

.53 

.64 

.54 

.39 

.15 

.55 

.69 

.13 

.48 

.52 

.73 

71 

,57 

.63 

.74 

.46 

.75 

80 

66 

.67 

.49 

82 

.50 

51 

.83 

.60 

.84 

.98 

.23 

.58 

.56 

76 



.59 
. 4 
.92 
.70 
.77 
.78 

79 
.25 
.93 

99 
.97 
.33 
.87 



COVER III 72 



CIRCLE 46 ON READER SERVICE CARD 

104 COMPUTER LANGUAGE ■ FEBRUARY 1985 



Steve Rank Inc 

Stride Micro 

Summit Software 

Systems Guild 

Thunder Software 

UniPress 

Western Wares 

Whitesmiths Ltd 

Wizard Systems 70 

Workman & Associates 78 

Zeducomp 80 

The index on this page is provided as a service to our readers. The 
publisher does not assume any liability for errors or omissions. 



68 
18 
88 
67 
68 
1 



.88 
,89 
.65 

38 
.90 
.85 

86 
.68 
.91 



NO POSTAGE 

NECESSARY 

IF MAILED 

IN THE 

UNITED STATES 



BUSINESS REPLY CARD 

FIRST CLASS PERMIT NO 22*81 SAN FRANCISCO, CA USA 

POSTAGE WILL BE PAID BY 



COMPUTER 



LANGUAGE 



PO. BOX 11747 
PHILADELPHIA, PA 19101 




NO POSTAGE 

NECESSARY 

IF MA! LEO 

IN THE 

UNITED STATES 



BUSINESS REPLY CARD 

FIP.ST CLASS PERMIT NO. 22*81 SAN FRANCISCO. CA USA 



POSTAGE WILL BE PAID BY 



COMPUTER 



LANGUAGE 



PO. BOX 11747 
PHILADELPHIA, PA 19101 




COMPUTER 



SUBSCRIBE 



LANGUAGE 



-over 



Subscribe to COMPUTER LANGUAGE today for only $24.95- 

30% savings off the single copy price. 

D Yes, start my Subscription to COMPUTER LANGUAGE today. The cost 

is only $24.95 for 1 year (12 issues). 
D I want to increase my savings even more — send me 2 years (24 

issues) of COMPUTER LANGUAGE for only $39.95. 
D Payment enclosed □ Bill me 

Name 

Company 

Address 

City, State, Zip . 

Please allow 6-8 weeks for delivery of first issue. Foreign orders must be prepaid in U.S. 
funds. Canada orders $30.95 per year. Outside the U.S., $36.95/year for surface mail or 
$54.95/year for airmail. 




SUBSCRIBE 



LANGUAGE 



Subscribe to COMPUTER LANGUAGE today for only $24.95— over 

30% savings off the single copy price. 

G Yes, start my Subscription to COMPUTER LANGUAGE today. The cost 

is only $24.95 for 1 year (1 2 issues). 
□ I want to increase my savings even more — send me 2 years (24 

issues) of COMPUTER LANGUAGE for only $39.95. 
D Payment enclosed D Bill me 

Name 



Company 

Address 

City, State, Zip 

Please allow 6-8 weeks for delivery of first issue. Foreign orders must be prepaid in U.S. 
funds. Canada orders $30.95 per year. Outside the U.S., $36.95/year for surface mail or 
$54.95/year for airmail. 



u 

I 

II 



FREE INFORMATION 



NO POSTAGE 

NECESSARY 

IF MAILED 

IN THE 

UNITED STATES 



BUSINESS REPLY CARD 

FIRST CLASS PERMIT NO. 27346 SAN FRANCISCO, CA USA 

POSTAGE WILL BE PAID BY 



COMPUTER 



LANGUAGE 

2443 FILLMORE STREET • SUITE 346 
SAN FRANCISCO, CA 941 15 





NO POSTAGE 

NECESSARY 

IF MAILED 

IN THE 

UNITED STATES 



Name . 



BUSINESS REPLY CARD 

FIRST CLASS PERMIT NO. 27346 SAN FRANCISCO, CA USA 

POSTAGE WILL BE PAID BY 



COMPUTER 



LANGUAGE 

2443 FILLMORE STREET ■ SUITE 346 
SAN FRANCISCO. CA 941 15 




! 



Company . 
Address — 



City, State, Zip 

Country Telephone number. 

February issue. Not good if moiled after June 30. 1985. 
Circle numbera tor which you desire Information. 



I obtained (his issue through: 

(J Subscription I 1 Passed on by associale 

f] Computer Store n Other 

Q Retail outlet 



Comments . 



1 tl 21 31 41 SI 61 7) 81 91 101 

2 12 22 32 12 52 62 72 82 92 102 

3 13 23 33 43 33 43 73 83 93 103 

4 14 24 34 44 54 64 74 84 94 104 

5 15 25 35 45 55 65 75 85 95 105 

6 16 26 36 44 56 66 76 86 96 106 

7 17 27 37 47 57 67 77 87 97 107 
B 18 28 38 48 58 68 78 88 98 108 

9 19 29 39 49 59 69 79 89 99 109 

10 70 30 40 50 60 70 SO 90 100 1 10 



111 121 

112 122 

113 123 

114 124 

115 125 

116 126 

117 127 
US 126 

119 129 

120 130 



131 141 

132 142 

133 143 

134 K4 

135 145 

136 146 

137 147 

138 148 

139 149 
HO 150 



Attn: Reader Service Dept. 



FREE INFORMATION 




Name . 



Company . 
Address 



City, Stale. Zip 

Country Telephone number 

February <ssue. Nol good il mailed after June 30, 1985. 
Circle numbers for which you desire Information, 



I obtained Ihis issue through: 

□ Subscription L I Passed on by associate 
Tl Computer Store □ Other 

□ Retail outlet 



Comments. 



1 


11 


71 


31 


41 


SI 


61 


71 


Bl 


91 


101 


111 


121 


131 


141 


2 


12 


22 


32 


42 


52 


62 


72 


82 


92 


10! 


112 


123 


132 


142 


3 


13 


23 


33 


43 


43 


63 


73 


13 


93 


103 


113 


123 


a :■ 


143 


4 


14 


24 


34 


44 


54 


64 


74 


84 


94 


104 


114 


124 


134 


144 


5 


IS 


25 


35 


45 


$5 


65 


75 


65 


95 


105 


115 


125 


135 


145 


6 


16 


24 


36 


44 


56 


•• 


76 


86 


96 


106 


116 


13d 


136 


146 


7 


17 


27 


37 


47 


37 


67 


77 


B7 


97 


107 


117 


127 


137 


147 


8 


IS 


28 


38 


48 


59 


68 


78 


86 


98 


108 


119 


133 


138 


148 


9 


19 


29 


39 


49 


59 


69 


79 


89 


99 


109 


119 


129 


139 


149 


10 


20 


30 


40 


SO 


00 


7D 


SO 


00 


100 


110 


120 


130 


140 


150 



Attn: Reader 5ervice Depl. 



Despite the recent press notices, 
multiuser microcomputers aren't 

anything new!" 



This is the first in a series of 
discussions with Hod Coleman, 
President of Stride Micro 
(formerly Sage Computer) on 
the 68000 multiuser market 
and its current environment. 

0: Why do you say thai? 
BC: "The technology to build a 
high performance multiuser sys- 
tem has been around for five 
years. And white some of the 
leaders in this industry have been 
pretending that micro multiuser 
didn't exist, we've been shipping 
complete systems for nearly three 
years. The benefits of multiuser 
are undeniable; it is more cost cf- 
feetive, and offers greater flexibil- 
ity and utility. But until just re- 
cently, the marketing pressure to 
be compatible instead oi being 
better, has blinded the industry." 

0; What do you mean'.' 
BC," "Well, for example, the 
Motorola 68000 processor intro- 
duced 16/32-bit technology to the 
personal computer world a long 
time ago. It was fully capable of 




"A surprising feature is 
compatibility. Everybody 
talks about it, but nobody 

does anything about it." 



meeting high performance and 
multiuser design requirements in 
1980. Instead of this trend taking 
off, most energy was spent pro- 
moting 8088/8086 products that 



were clearly inferior from it tech- 
nical point of view. This phenom- 
enon leads me to believe that they 
will soon rewrite the old proverb: 
'Build a better mousetrap and the 
world will beat a path to your 
door," but only if they can find the 
way through the marketing fog." 
Q: Are things changing now? 
BC: "Yes and no. With the busi- 
ness world starling to take more 
and more interest in microcompu- 
ter solutions, the advantages of a 
solid multiuser system couldn't be 
kept hidden forever, companies 
like ours and a few others were 
beginning to make a dent. Instead 
of taking a fresh approach, some 
of the newest multiuser offerings 
will probably only give the tech- 
nology an undeserved black eye! 
Multiuser is far more than the 
ability to plug in more terminals. 
It involves things like machine 
compatibility, last processors, 
adequate memory, large storage 
capacities, backup features, net- 
working, and operating system 
flexibility." 

(J: Is this what makes the new 
Stride 400 Series different? 
BC: "Exactly. Thai sounds self- 
serving, but it's true. Today a 
number of companies are intro- 
ducing their first multiuser sys- 
tem. We've been building and 
shipping multiuser machines for 
almost three years. We know the 
pitfalls, we've fallen into some of 
them. But we have learned from 
our mistakes." 
0; Give me some examples. 
BC; A hard disk is almost manda- 
tory for any large multiuser in- 
stallation. Yel, backing up a hard 
disk can be a nightmare if you 
only have floppies to work with. 
That's why we've added a tape 
backup opiion lo all the larger 
Stride 400 Series machines. It's 
irresponsible for a manufacturer 
to market a multiuser system 
without such backup. Another 
good lesson was bus design. We 
started with one of our own de- 
signs, but learned that it's impor- 
tant not only to find a bus that is 
powerful, but also one that has 
good support and a strong future 
lo serve tomorrow's needs. We 




'The marketing pressure 

to be compatible 

instead of being better, 

has blinded the industry.' 



think the VMEbus is the only de- 
sign that meets both criteria and 
thus have made it a standard fea- 
ture of every Stride 400 Series 
machine." 

0: What are some of the other 
unique features of the 400 Series? 
BC: "A surprising feature is com- 
patibility. Everybody talks about 
it, but nobody does anything 
about it. Our systems are com- 
pletely compatible with each other 
from the 420 model starting at ' 
$2900. through the 440, on to the 
powerful 460 which tops out near 
S60.000. Each system can talk to 
the others via the standard built-in 
local area network. Go ahead and 
compare this with others in the in- 
dustry. You'll find their little ma- 
chines don't talk to their big ones, 
or that the networking and multi- 
user are incompatible, or that they 
have different processors or 
operating systems, and so on." 
0: When you were still known as 
Sage Computer, you had a reputa- 
tion for performance, is that still 
the case with the new Stride 400 
Series? 

BC; "Certainly, that's our calling 
card: 'Performance By Design.' 
Our new systems are actually fas- 
ter, our standard processor is a 10 
MHz 68000 running with no wait 



stales. That gives us a 25% in- 
crease over the Sage models. 
And, we have a 12 MHz pro- 
cessor as an option. Let me add 
that speed isn't the only way to 
judge performance. I think it is 
also measured in our flexibility. 
We support a dozen different 
operating systems, not just one. 
And our systems service a wide 
variety of applications from the 
garage software developer to the 
corporate consumer running high 
volume business applications." 
(J: Isn't thai the same thing all 
manufacturers say in their ads? 
BC: "Sure it is. But lo use another 
over used-term, 'shop around'. 
We like to think of our systems as 
■full service 68000 supennicro- 
eomputers." Take a look at every- 
one else's literature and then 
compare. When you examine 
cost, performance, flexibility, and 
utility, we don't think there's any- 
one else in the 
race. Maybe 
that's why we've 
shipped and 
installed more 
multiuser 68000 
systems than 
anyone else." 




FunncrJy Sjigc Computer 

For more information on Stride or 
the location of the nearest Stride 
Dealer call or write us today. 
We'll also send you a free copy of 
our 32 page product catalog. 

Corporate Offices: 
4905 Enerey Way 
Reno, NV 89502 
(702) 322-6868 

Regional Offices: 
Boston: (617) 229-6868 
Dallas: (214) 392-7070 



CIRCLE 72 ON READER SERVICE CARD 



THINKING COMPUTERS? 




Think CompuPro 




........ v 

CompuPro •\qplus 

"... a coherent, relatively easy to 
use [multi-user] system with an 
impressive amount of power for 
the money and good support... 
alternative to stand alone— or 
even networked — computers, the 
CompuPro 10 has a lot going for 

it " 

Persona! Computing, 12/84 

S7995.00 suggested list witft 40 Mb haid disk 




CompuPro 286 

A faster version of our multi-user 
Model C, of which a recent review 
states "... hardware is high quality 
... large software base... hundreds 
of serious business programs... 
versatility and adaptability to 
future hardware and software 
developments are unmatched..." 
Business Computer Systems, 9/84 



«V«asyn 1985 



$9995.00 suggested list with 40Mb hard disk and cartridge tape 
CIRCLE 12 ON READER SERVICE CARD 

To arrange a demonstration, call 1-800-367-7816 (in California, 1-415-786-0909). 
Viasyn Corporation, 3506 Breakwater Court, Hayward, CA 94545 



«